]> granicus.if.org Git - php/commitdiff
Fixed smart_str0 for empty str(more friendly for user?)
authorXinchen Hui <laruence@gmail.com>
Mon, 24 Mar 2014 06:06:35 +0000 (14:06 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 24 Mar 2014 06:06:35 +0000 (14:06 +0800)
ext/standard/php_smart_str.h

index e11eb734ed7ac944778f993e66f5afebdd6ebe76..283d3eb8b7a05dcdb0037f3d57b025d545b7f6c8 100644 (file)
@@ -31,6 +31,8 @@
 #define smart_str_0(x) do {                                                                                    \
        if ((x)->s) {                                                                                                   \
                (x)->s->val[(x)->s->len] = '\0';                                                        \
+       } else {                                                                                                                \
+               smart_str_appendc((x), '\0');                                                           \
        }                                                                                                                               \
 } while (0)