summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:12 (GMT)
commit73df1b34218b1bce579a3ed90166db9df43d9e67 (patch)
tree035ec71a87f4f7f49fdab328f8e652dbe7f114a4 /contrib
parent2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc (diff)
parentcd9a4b6d9339ec81575e1af13c10bfcbba45a22f (diff)
downloadgit-73df1b34218b1bce579a3ed90166db9df43d9e67.zip
git-73df1b34218b1bce579a3ed90166db9df43d9e67.tar.gz
git-73df1b34218b1bce579a3ed90166db9df43d9e67.tar.bz2
Merge branch 'rs/strbuf-cocci-workaround'
Update Coccinelle rules to catch and optimize strbuf_addf(&buf, "%s", str) * rs/strbuf-cocci-workaround: cocci: use format keyword instead of a literal string
Diffstat (limited to 'contrib')
-rw-r--r--contrib/coccinelle/strbuf.cocci3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/coccinelle/strbuf.cocci b/contrib/coccinelle/strbuf.cocci
index 1d580e4..6fe8727 100644
--- a/contrib/coccinelle/strbuf.cocci
+++ b/contrib/coccinelle/strbuf.cocci
@@ -29,8 +29,9 @@ cocci.include_match("%" not in fmt)
@@
expression E1, E2;
+format F =~ "s";
@@
-- strbuf_addf(E1, "%s", E2);
+- strbuf_addf(E1, "%@F@", E2);
+ strbuf_addstr(E1, E2);
@@