projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae71339
)
Make ds_vprintf() properly handle a null string.
author
Ben Pfaff
<blp@gnu.org>
Mon, 17 Apr 2006 03:36:40 +0000
(
03:36
+0000)
committer
Ben Pfaff
<blp@gnu.org>
Mon, 17 Apr 2006 03:36:40 +0000
(
03:36
+0000)
src/libpspp/ChangeLog
patch
|
blob
|
history
src/libpspp/str.c
patch
|
blob
|
history
diff --git
a/src/libpspp/ChangeLog
b/src/libpspp/ChangeLog
index ff8d321e5b255a3cd65c3ce6a3f41e7c416623f6..2c80db58c339be0744a6337cd13f2a8150890900 100644
(file)
--- a/
src/libpspp/ChangeLog
+++ b/
src/libpspp/ChangeLog
@@
-1,3
+1,8
@@
+Sun Apr 16 20:33:19 2006 Ben Pfaff <blp@gnu.org>
+
+ * str.c (ds_vprintf): Don't try to write into the string if it is
+ null.
+
Sun Apr 16 18:52:41 2006 Ben Pfaff <blp@gnu.org>
GNU standards require "file name" instead of "filename" in
diff --git
a/src/libpspp/str.c
b/src/libpspp/str.c
index c72f19969ec8f1090f958e39c36a276f6b5b1f8f..c8497c34af4fbf1dd57ace97d18d1ad72e60116c 100644
(file)
--- a/
src/libpspp/str.c
+++ b/
src/libpspp/str.c
@@
-704,7
+704,7
@@
ds_vprintf (struct string *st, const char *format, va_list args_)
#endif
va_copy (args, args_);
- avail = st->
capacity - st->length + 1
;
+ avail = st->
string != NULL ? st->capacity - st->length + 1 : 0
;
needed = vsnprintf (st->string + st->length, avail, format, args);
va_end (args);