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
This commit is contained in:
Junio C Hamano 2018-02-13 13:39:12 -08:00
commit 73df1b3421

View file

@ -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);
@@