summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-02-13 13:39:12 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-13 13:39:12 -0800
commit73df1b34218b1bce579a3ed90166db9df43d9e67 (patch)
tree035ec71a87f4f7f49fdab328f8e652dbe7f114a4 /contrib
parentMerge branch 'mr/packed-ref-store-fix' (diff)
parentcocci: use format keyword instead of a literal string (diff)
downloadtgif-73df1b34218b1bce579a3ed90166db9df43d9e67.tar.xz
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 1d580e49b0..6fe8727421 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);
@@