From f4eeb7745ee1aa395dc4873f5d850ad0429f2533 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sat, 15 Sep 2012 10:50:19 +0200 Subject: [PATCH] Return a negative value to indicate truncation. If the maximum availalbe buffer size is zero, no data can be written (not even the NULL terminator), and a negative values should be returned to indicate truncation. --- src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.c b/src/context.c index a0cf839..0163a3c 100644 --- a/src/context.c +++ b/src/context.c @@ -50,7 +50,7 @@ l_vsnprintf (char *str, size_t size, const char *format, va_list ap) int n; if (size == 0) - return 0; + return -1; #ifdef _MSC_VER /*