diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-14 00:39:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-14 00:39:12 +0300 |
commit | 73df1b34218b1bce579a3ed90166db9df43d9e67 (patch) | |
tree | 035ec71a87f4f7f49fdab328f8e652dbe7f114a4 | |
parent | 2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc (diff) | |
parent | cd9a4b6d9339ec81575e1af13c10bfcbba45a22f (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.cocci | 3 |
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); @@ |