summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strbuf.c b/strbuf.c
index 4df30b4549..c8a5789694 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -52,8 +52,8 @@ char strbuf_slopbuf[1];
void strbuf_init(struct strbuf *sb, size_t hint)
{
- sb->alloc = sb->len = 0;
- sb->buf = strbuf_slopbuf;
+ struct strbuf blank = STRBUF_INIT;
+ memcpy(sb, &blank, sizeof(*sb));
if (hint)
strbuf_grow(sb, hint);
}