projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edafda5
)
Another fix to snprintf().
author
Bruno Haible
<bruno@clisp.org>
Fri, 1 Oct 2004 13:27:20 +0000
(13:27 +0000)
committer
Bruno Haible
<bruno@clisp.org>
Fri, 1 Oct 2004 13:27:20 +0000
(13:27 +0000)
lib/ChangeLog
patch
|
blob
|
history
lib/snprintf.c
patch
|
blob
|
history
diff --git
a/lib/ChangeLog
b/lib/ChangeLog
index a701b151fb77f5dd9c834b7c3d23e2c7b743981e..7d2c82872e1e5e9b121ae2b6c81168f3cc3cbb0f 100644
(file)
--- a/
lib/ChangeLog
+++ b/
lib/ChangeLog
@@
-1,3
+1,7
@@
+2004-10-01 Simon Josefsson <jas@extundo.com>
+
+ * snprintf.c (snprintf): Handle size==0.
+
2004-10-01 Simon Josefsson <jas@extundo.com>
Bruno Haible <bruno@clisp.org>
diff --git
a/lib/snprintf.c
b/lib/snprintf.c
index 92c265289a3730865150acb7c9781092b9f555cf..c23d7e14a39d92b42953128c060ef6f6835b9114 100644
(file)
--- 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';