From: Xinchen Hui Date: Mon, 24 Mar 2014 06:06:35 +0000 (+0800) Subject: Fixed smart_str0 for empty str(more friendly for user?) X-Git-Tag: POST_PHPNG_MERGE~412^2~228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e96c912fc7f6b5fec72521fe4a560fcab0478b9;p=php Fixed smart_str0 for empty str(more friendly for user?) --- diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index e11eb734ed..283d3eb8b7 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -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)