Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-14 00:39:12 +0300
committerJunio C Hamano <gitster@pobox.com>2018-02-14 00:39:12 +0300
commit73df1b34218b1bce579a3ed90166db9df43d9e67 (patch)
tree035ec71a87f4f7f49fdab328f8e652dbe7f114a4
parent2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc (diff)
parentcd9a4b6d9339ec81575e1af13c10bfcbba45a22f (diff)
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
-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);
@@