diff options
author | Bruno Haible <bruno@clisp.org> | 2004-10-01 13:27:20 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2004-10-01 13:27:20 +0000 |
commit | 6dc8b58f2a657faf8c1dd2e9438faab2a016c034 (patch) | |
tree | 6e52fa115cc272a3404eea4d698ec1e0539d5530 /lib/snprintf.c | |
parent | edafda534244e3760000faf7a088af872d146325 (diff) | |
download | gnulib-6dc8b58f2a657faf8c1dd2e9438faab2a016c034.tar.gz |
Another fix to snprintf().
Diffstat (limited to 'lib/snprintf.c')
-rw-r--r-- | lib/snprintf.c | 2 |
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'; |