aboutsummaryrefslogtreecommitdiff
path: root/src/stringbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stringbuf.c')
-rw-r--r--src/stringbuf.c6
1 files changed, 4 insertions, 2 deletions
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;