strbuf: use strbuf_addchars() for adding a char multiple times
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
d07235a027
commit
415792edf5
@ -163,9 +163,7 @@ static void output(struct merge_options *o, int v, const char *fmt, ...)
|
||||
if (!show(o, v))
|
||||
return;
|
||||
|
||||
strbuf_grow(&o->obuf, o->call_depth * 2 + 2);
|
||||
memset(o->obuf.buf + o->obuf.len, ' ', o->call_depth * 2);
|
||||
strbuf_setlen(&o->obuf, o->obuf.len + o->call_depth * 2);
|
||||
strbuf_addchars(&o->obuf, ' ', o->call_depth * 2);
|
||||
|
||||
va_start(ap, fmt);
|
||||
strbuf_vaddf(&o->obuf, fmt, ap);
|
||||
|
||||
Reference in New Issue
Block a user