From e992d1eb39033206dd44143ff28214b837c3d89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 10 Jul 2014 10:52:21 +0200 Subject: [PATCH] use strbuf_addbuf for adding strbufs Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- builtin/log.c | 2 +- pretty.c | 2 +- rerere.c | 4 ++-- sha1_name.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/log.c b/builtin/log.c index 27c1b65db4..4389722b4b 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -861,7 +861,7 @@ static void add_branch_description(struct strbuf *buf, const char *branch_name) read_branch_desc(&desc, branch_name); if (desc.len) { strbuf_addch(buf, '\n'); - strbuf_add(buf, desc.buf, desc.len); + strbuf_addbuf(buf, &desc); strbuf_addch(buf, '\n'); } } diff --git a/pretty.c b/pretty.c index 8d201f6bda..6e54934723 100644 --- a/pretty.c +++ b/pretty.c @@ -1376,7 +1376,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */ case trunc_none: break; } - strbuf_addstr(sb, local_sb.buf); + strbuf_addbuf(sb, &local_sb); } else { int sb_len = sb->len, offset = 0; if (c->flush_type == flush_left) diff --git a/rerere.c b/rerere.c index d55aa8a01b..04d923d8cf 100644 --- a/rerere.c +++ b/rerere.c @@ -207,11 +207,11 @@ static int handle_path(unsigned char *sha1, struct rerere_io *io, int marker_siz strbuf_reset(&one); strbuf_reset(&two); } else if (hunk == RR_SIDE_1) - strbuf_addstr(&one, buf.buf); + strbuf_addbuf(&one, &buf); else if (hunk == RR_ORIGINAL) ; /* discard */ else if (hunk == RR_SIDE_2) - strbuf_addstr(&two, buf.buf); + strbuf_addbuf(&two, &buf); else rerere_io_putstr(buf.buf, io); continue; diff --git a/sha1_name.c b/sha1_name.c index 5bfa841699..6ccd3a53f8 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -946,7 +946,7 @@ static int interpret_nth_prior_checkout(const char *name, int namelen, retval = 0; if (0 < for_each_reflog_ent_reverse("HEAD", grab_nth_branch_switch, &cb)) { strbuf_reset(buf); - strbuf_add(buf, cb.buf.buf, cb.buf.len); + strbuf_addbuf(buf, &cb.buf); retval = brace - name + 1; }