Skip to content

Commit

Permalink
use strbuf_addch for adding single characters
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Jul 10, 2014
1 parent e992d1e commit 294b268
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion pathspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion url.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 294b268

Please sign in to comment.