X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=strbuf.c;fp=strbuf.c;h=d381c1d95bec4873bff07c97ebee9c4fc3f3d980;hb=812666c8e66a21e668c0789d0422aa5a7db54961;hp=dac945c7c8ec3ca14791e472fd19a47cc07dcd15;hpb=f2a19340ada1188e278d5b198d3466ed7411e2d4;p=git.git diff --git a/strbuf.c b/strbuf.c index dac945c7..d381c1d9 100644 --- a/strbuf.c +++ b/strbuf.c @@ -1,6 +1,7 @@ #include #include #include "strbuf.h" +#include "cache.h" void strbuf_init(struct strbuf *sb) { sb->buf = 0; @@ -15,7 +16,7 @@ static void strbuf_begin(struct strbuf *sb) { static void inline strbuf_add(struct strbuf *sb, int ch) { if (sb->alloc <= sb->len) { sb->alloc = sb->alloc * 3 / 2 + 16; - sb->buf = realloc(sb->buf, sb->alloc); + sb->buf = xrealloc(sb->buf, sb->alloc); } sb->buf[sb->len++] = ch; }