X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=strbuf.c;h=09c43ae59a7d4715c26f13d72ca37bc759d1c76d;hb=22fdd11432d6177ad6f8b9e32f0c4a8101542786;hp=77444a94df3d4a0cda6403957fd13ea262d3ab24;hpb=54f6a8dbd65cbe6ad31a8b6b531de81009514eb3;p=git.git diff --git a/strbuf.c b/strbuf.c index 77444a94d..09c43ae59 100644 --- a/strbuf.c +++ b/strbuf.c @@ -30,8 +30,10 @@ void strbuf_init(struct strbuf *sb, size_t hint) { sb->alloc = sb->len = 0; sb->buf = strbuf_slopbuf; - if (hint) + if (hint) { strbuf_grow(sb, hint); + sb->buf[0] = '\0'; + } } void strbuf_release(struct strbuf *sb)