Skip to content

Commit 294b268

Browse files
rscharfegitster
authored andcommitted
use strbuf_addch for adding single characters
Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e992d1e commit 294b268

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static void output(struct merge_options *o, int v, const char *fmt, ...)
171171
strbuf_vaddf(&o->obuf, fmt, ap);
172172
va_end(ap);
173173

174-
strbuf_add(&o->obuf, "\n", 1);
174+
strbuf_addch(&o->obuf, '\n');
175175
if (!o->buffer_output)
176176
flush_output(o);
177177
}

pathspec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static void NORETURN unsupported_magic(const char *pattern,
338338
if (!(magic & m->bit))
339339
continue;
340340
if (sb.len)
341-
strbuf_addstr(&sb, " ");
341+
strbuf_addch(&sb, ' ');
342342
if (short_magic & m->bit)
343343
strbuf_addf(&sb, "'%c'", m->mnemonic);
344344
else

url.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void end_url_with_slash(struct strbuf *buf, const char *url)
121121
{
122122
strbuf_addstr(buf, url);
123123
if (buf->len && buf->buf[buf->len - 1] != '/')
124-
strbuf_addstr(buf, "/");
124+
strbuf_addch(buf, '/');
125125
}
126126

127127
void str_end_url_with_slash(const char *url, char **dest) {

0 commit comments

Comments
 (0)