use strbuf_addstr() for adding constant strings to a strbuf, part 2
Replace uses of strbuf_addf() for adding strings with more lightweight
strbuf_addstr() calls. This makes the intent clearer and avoids
potential issues with printf format specifiers.
02962d3684
already converted six cases,
this patch covers eleven more.
A semantic patch for Coccinelle is included for easier checking for
new cases that might be introduced in the future.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
63f0a758a0
commit
a22ae753cb
@ -940,7 +940,7 @@ static void write_merge_state(struct commit_list *remoteheads)
|
||||
|
||||
strbuf_reset(&buf);
|
||||
if (fast_forward == FF_NO)
|
||||
strbuf_addf(&buf, "no-ff");
|
||||
strbuf_addstr(&buf, "no-ff");
|
||||
write_file_buf(git_path_merge_mode(), buf.buf, buf.len);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user