Sun, 24 Apr 2022 17:44:52 +0200
fix cxBufferMinimumCapacity not using the allocator
src/buffer.c | file | annotate | diff | comparison | revisions |
--- a/src/buffer.c Sun Apr 24 17:29:34 2022 +0200 +++ b/src/buffer.c Sun Apr 24 17:44:52 2022 +0200 @@ -119,9 +119,7 @@ return 0; } - unsigned char *newspace = realloc(buffer->bytes, newcap); - if (newspace) { - buffer->bytes = newspace; + if (cxReallocate(buffer->allocator, &buffer->bytes, newcap) == 0) { buffer->capacity = newcap; return 0; } else {