cvs: php4 /main spprintf.c
| From: | Marcus B�rger | Date: | Sun, 23 Jun 2002 22:02:35 +0000 |
| Subject: | cvs: php4 /main spprintf.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12468@lists.php.net to get a copy of this message | ||
helly Sun Jun 23 18:02:35 2002 EDT
Modified files:
/php4/main spprintf.c
Log:
-allways terminate buffer
-allow pbuf parameter to be NULL for buffer size calculation
Index: php4/main/spprintf.c
diff -u php4/main/spprintf.c:1.4 php4/main/spprintf.c:1.5
--- php4/main/spprintf.c:1.4 Tue May 7 13:51:03 2002
+++ php4/main/spprintf.c Sun Jun 23 18:02:35 2002
@@ -627,7 +627,10 @@
cc = xbuf_format_converter(&xbuf, format, ap);
if (xbuf.nextb <= xbuf.buf_end)
*(xbuf.nextb) = '\0';
- *pbuf = xbuf.buf;
+ else if (xbuf.size)
+ xbuf.buf[xbuf.size-1] = '\0';
+ if (pbuf)
+ *pbuf = xbuf.buf;
return cc;
}
}