From b8ab5e2d6b3f34f4c56b906130ba63173df8f2d0 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Sun, 12 Feb 2017 23:50:54 +0200 Subject: Fixes to make code to almost compile on -std=c89 setting --- src/stringbuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/stringbuf.c') diff --git a/src/stringbuf.c b/src/stringbuf.c index bc71dc3..1c250ca 100644 --- a/src/stringbuf.c +++ b/src/stringbuf.c @@ -45,9 +45,11 @@ size_t StringBufAvailable(StringBuf *buf) int StringBufGrow(StringBuf *buf, size_t size) { + size_t newSize; + char *ptr; assert(buf != NULL); - size_t newSize = buf->size + size; - char *ptr = realloc(buf->data, newSize+1); + newSize = buf->size + size; + ptr = realloc(buf->data, newSize+1); if (!ptr) return -1; buf->data = ptr; -- cgit v1.2.3