src/buffer.c

changeset 1005
67fa386ce600
parent 1004
d8044fd5005c
child 1007
81b2986d2b04
--- a/src/buffer.c	Mon Dec 09 23:31:42 2024 +0100
+++ b/src/buffer.c	Tue Dec 10 00:07:16 2024 +0100
@@ -316,6 +316,17 @@
     }
 }
 
+int cxBufferTerminate(CxBuffer *buffer) {
+    bool success = 0 == cxBufferPut(buffer, 0);
+    if (success) {
+        buffer->pos--;
+        buffer->size--;
+        return 0;
+    } else {
+        return 1;
+    }
+}
+
 size_t cxBufferPutString(
         CxBuffer *buffer,
         const char *str

mercurial