summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-07 09:03:32 +0200
committerJunio C Hamano <gitster@pobox.com>2014-09-08 11:26:45 -0700
commitd07235a027e0c7ed2fee1aeb3bee8a858bf5ca58 (patch)
tree8805b3767a1d86908c448aef92e56036fdeee92b /strbuf.c
parente6aaa393478bf3ee9f4cde8d82cd258c034cd335 (diff)
downloadgit-d07235a027e0c7ed2fee1aeb3bee8a858bf5ca58.tar.gz
strbuf: export strbuf_addchars()
Move strbuf_addchars() to strbuf.c, where it belongs, and make it available for other callers. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index 1170d01c43..5e44cf9204 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -196,6 +196,13 @@ void strbuf_adddup(struct strbuf *sb, size_t pos, size_t len)
strbuf_setlen(sb, sb->len + len);
}
+void strbuf_addchars(struct strbuf *sb, int c, size_t n)
+{
+ strbuf_grow(sb, n);
+ memset(sb->buf + sb->len, c, n);
+ strbuf_setlen(sb, sb->len + n);
+}
+
void strbuf_addf(struct strbuf *sb, const char *fmt, ...)
{
va_list ap;