summaryrefslogtreecommitdiff
path: root/lib/snprintf.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2004-10-01 13:27:20 +0000
committerBruno Haible <bruno@clisp.org>2004-10-01 13:27:20 +0000
commit6dc8b58f2a657faf8c1dd2e9438faab2a016c034 (patch)
tree6e52fa115cc272a3404eea4d698ec1e0539d5530 /lib/snprintf.c
parentedafda534244e3760000faf7a088af872d146325 (diff)
downloadgnulib-6dc8b58f2a657faf8c1dd2e9438faab2a016c034.tar.gz
Another fix to snprintf().
Diffstat (limited to 'lib/snprintf.c')
-rw-r--r--lib/snprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/snprintf.c b/lib/snprintf.c
index 92c265289a..c23d7e14a3 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -55,7 +55,7 @@ snprintf (char *str, size_t size, const char *format, ...)
if (!output)
return -1;
- if (str)
+ if (str && size > 0)
{
memcpy (str, output, MIN (len + 1, size));
str[size - 1] = '\0';