--- 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