Skip to content

Commit 73df1b3

Browse files
committed
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
2 parents 2b72ea0 + cd9a4b6 commit 73df1b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/coccinelle/strbuf.cocci

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ cocci.include_match("%" not in fmt)
2929

3030
@@
3131
expression E1, E2;
32+
format F =~ "s";
3233
@@
33-
- strbuf_addf(E1, "%s", E2);
34+
- strbuf_addf(E1, "%@F@", E2);
3435
+ strbuf_addstr(E1, E2);
3536

3637
@@

0 commit comments

Comments
 (0)