diff options
author | June McEnroe <june@causal.agency> | 2020-11-29 18:32:05 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-11-29 18:32:05 -0500 |
commit | 3d749fe89f46d580f51f305345fde1aae42eecc5 (patch) | |
tree | f446ed21164a7f2bb6e9d6b2254d0bcdb7ebd243 | |
parent | Fall back to multipart export for alternative without suitable inline (diff) | |
download | bubger-3d749fe89f46d580f51f305345fde1aae42eecc5.tar.gz bubger-3d749fe89f46d580f51f305345fde1aae42eecc5.zip |
Fix bufferDest for when len requires more than cap * 2
Diffstat (limited to '')
-rw-r--r-- | decode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/decode.c b/decode.c index 684b5d2..5d875ca 100644 --- a/decode.c +++ b/decode.c @@ -55,7 +55,7 @@ static struct Buffer bufferAlloc(size_t cap) { static char *bufferDest(struct Buffer *buf, size_t len) { if (buf->len + len > buf->cap) { - buf->cap *= 2; + while (buf->len + len > buf->cap) buf->cap *= 2; buf->ptr = realloc(buf->ptr, buf->cap); if (!buf->ptr) err(EX_OSERR, "realloc"); } |