src/buffer.c

changeset 989
8aa57a7fecc4
parent 985
68754c7de906
--- a/src/buffer.c	Mon Nov 18 22:05:42 2024 +0100
+++ b/src/buffer.c	Sat Nov 23 14:45:32 2024 +0100
@@ -38,7 +38,9 @@
         const CxAllocator *allocator,
         int flags
 ) {
-    if (allocator == NULL) allocator = cxDefaultAllocator;
+    if (allocator == NULL) {
+        allocator = cxDefaultAllocator;
+    }
     buffer->allocator = allocator;
     buffer->flags = flags;
     if (!space) {
@@ -75,6 +77,9 @@
         const CxAllocator *allocator,
         int flags
 ) {
+    if (allocator == NULL) {
+        allocator = cxDefaultAllocator;
+    }
     CxBuffer *buf = cxMalloc(allocator, sizeof(CxBuffer));
     if (buf == NULL) return NULL;
     if (0 == cxBufferInit(buf, space, capacity, allocator, flags)) {

mercurial