diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2017-02-12 23:50:54 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2017-02-12 23:50:54 +0200 |
| commit | b8ab5e2d6b3f34f4c56b906130ba63173df8f2d0 (patch) | |
| tree | 24e1c88bb75c2e439ce95c312bb54c9867ac531a /src/stringbuf.c | |
| parent | c742eeb2a4192f05b5e594830fafea116243b431 (diff) | |
| download | mqtt-b8ab5e2d6b3f34f4c56b906130ba63173df8f2d0.tar.gz mqtt-b8ab5e2d6b3f34f4c56b906130ba63173df8f2d0.zip | |
Fixes to make code to almost compile on -std=c89 setting
Diffstat (limited to 'src/stringbuf.c')
| -rw-r--r-- | src/stringbuf.c | 6 |
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; |
