diff -r b02ad05c7f2d -r fda0f1910d7e src/printf.c --- a/src/printf.c Tue Jan 16 23:15:36 2024 +0100 +++ b/src/printf.c Tue Jan 16 23:16:15 2024 +0100 @@ -108,7 +108,7 @@ va_list ap2; va_copy(ap2, ap); int ret = vsnprintf(buf, CX_PRINTF_SBO_SIZE, fmt, ap); - if (ret > 0 && ret < CX_PRINTF_SBO_SIZE) { + if (ret >= 0 && ret < CX_PRINTF_SBO_SIZE) { s.ptr = cxMalloc(a, ret + 1); if (s.ptr) { s.length = (size_t) ret;