src/string.c

changeset 1685
0344372c7115
parent 1679
4a08dabe5e8f
child 1693
c2d05cf1a062
--- a/src/string.c	Wed Dec 31 12:24:39 2025 +0100
+++ b/src/string.c	Wed Dec 31 12:33:16 2025 +0100
@@ -106,7 +106,11 @@
         ...
 ) {
     if (count == 0) {
-        return cx_strdup_a(alloc, str);
+        if (cxReallocate(alloc, &str.ptr, str.length + 1)) {
+            return CX_NULLSTR; // LCOV_EXCL_LINE
+        }
+        str.ptr[str.length] = '\0';
+        return str;
     }
     va_list ap;
     va_start(ap, count);

mercurial