@ strbuf_addf_with_format_only @
expression E;
-constant fmt;
+constant fmt !~ "%";
@@
- strbuf_addf(E,
+- strbuf_addf
++ strbuf_addstr
+ (E,
(
fmt
|
)
);
-@ script:python @
-fmt << strbuf_addf_with_format_only.fmt;
@@
-cocci.include_match("%" not in fmt)
+expression E;
+struct strbuf SB;
+format F =~ "s";
+@@
+- strbuf_addf(E, "%@F@", SB.buf);
++ strbuf_addbuf(E, &SB);
-@ extends strbuf_addf_with_format_only @
@@
-- strbuf_addf
-+ strbuf_addstr
- (E,
-(
- fmt
-|
- _(fmt)
-)
- );
+expression E;
+struct strbuf *SBP;
+format F =~ "s";
+@@
+- strbuf_addf(E, "%@F@", SBP->buf);
++ strbuf_addbuf(E, SBP);
+
+@@
+expression E;
+struct strbuf SB;
+@@
+- strbuf_addstr(E, SB.buf);
++ strbuf_addbuf(E, &SB);
+
+@@
+expression E;
+struct strbuf *SBP;
+@@
+- strbuf_addstr(E, SBP->buf);
++ strbuf_addbuf(E, SBP);
@@
expression E1, E2;