SZEDER Gábor <[email protected]> writes:
>> if (entry)
>> - fprintf(out, "\n%c Branch %s\n", comment_line_char,
>> entry->string);
>> + strbuf_addf(out, "\n%c Branch %s\n", comment_line_char,
>> entry->string);
>> else
>> - fprintf(out, "\n");
>> + strbuf_addf(out, "\n");
>
> Please use plain strbuf_add() here.
FWIW, contrib/coccinelle/strbuf.cocci.patch gave us this:
diff -u -p a/sequencer.c b/sequencer.c
--- a/sequencer.c
+++ b/sequencer.c
@@ -4311,7 +4311,7 @@ static int make_script_with_merges(struc
if (entry)
strbuf_addf(out, "\n%c Branch %s\n", comment_line_char,
entry->string);
else
- strbuf_addf(out, "\n");
+ strbuf_addstr(out, "\n");
while (oidset_contains(&interesting, &commit->object.oid) &&
!oidset_contains(&shown, &commit->object.oid)) {