use strbuf_addch for adding single characters

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-07-10 10:54:24 +02:00 committed by Junio C Hamano
parent e992d1eb39
commit 294b2680cd
3 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ static void output(struct merge_options *o, int v, const char *fmt, ...)
strbuf_vaddf(&o->obuf, fmt, ap);
va_end(ap);
strbuf_add(&o->obuf, "\n", 1);
strbuf_addch(&o->obuf, '\n');
if (!o->buffer_output)
flush_output(o);
}

View File

@ -338,7 +338,7 @@ static void NORETURN unsupported_magic(const char *pattern,
if (!(magic & m->bit))
continue;
if (sb.len)
strbuf_addstr(&sb, " ");
strbuf_addch(&sb, ' ');
if (short_magic & m->bit)
strbuf_addf(&sb, "'%c'", m->mnemonic);
else

2
url.c
View File

@ -121,7 +121,7 @@ void end_url_with_slash(struct strbuf *buf, const char *url)
{
strbuf_addstr(buf, url);
if (buf->len && buf->buf[buf->len - 1] != '/')
strbuf_addstr(buf, "/");
strbuf_addch(buf, '/');
}
void str_end_url_with_slash(const char *url, char **dest) {