aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strbuf.c b/strbuf.c
index dac945c7c..d381c1d95 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#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;
}