]> git.ipfire.org Git - thirdparty/git.git/blobdiff - strbuf.c
reftable: add dump utility
[thirdparty/git.git] / strbuf.c
index 4df30b45494de819825fa32dca66040ff0882129..c8a5789694cf805799a288b66e517bedf786e479 100644 (file)
--- 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);
 }