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:
René Scharfe
2014-09-07 09:06:42 +02:00
committed by Junio C Hamano
parent d07235a027
commit 415792edf5
3 changed files with 6 additions and 13 deletions

View File

@ -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);