From: Junio C Hamano Date: Wed, 7 Feb 2018 22:55:56 +0000 (-0800) Subject: Merge branch 'rs/strbuf-cocci-workaround' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/73a2c4c769a9582b24e2119e340790fc96c3da7c?hp=17d32e99dad726640c39bbd236fc67854d2cc2ef Merge branch 'rs/strbuf-cocci-workaround' into next 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 --- 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); @@