]> granicus.if.org Git - php/commitdiff
- Need to terminate [v]uspprintf() with two \0
authorMarcus Boerger <helly@php.net>
Sun, 14 Aug 2005 21:04:52 +0000 (21:04 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 14 Aug 2005 21:04:52 +0000 (21:04 +0000)
main/spprintf.c

index 12b4fb843e92f107b9b499af9882ef9759a2bb32..1b0166d8e38ca8be7e1124ee53358fd8a88a21ce 100644 (file)
@@ -847,6 +847,7 @@ PHPAPI int vuspprintf(char **pbuf, size_t max_len, const char *format, va_list a
        if (max_len && xbuf.len > max_len) {
                xbuf.len = max_len;
        }
+       smart_str_appendc(&xbuf, '\0'); /* we need \0\0 as termination */
        smart_str_0(&xbuf);
                
        *pbuf = xbuf.c;