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