summaryrefslogtreecommitdiff
path: root/ext/standard/php_smart_str.h
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-03-24 14:06:35 +0800
committerXinchen Hui <laruence@gmail.com>2014-03-24 14:06:35 +0800
commit9e96c912fc7f6b5fec72521fe4a560fcab0478b9 (patch)
tree36eddad0172bbbdcb19bfab2b82386378ebedce4 /ext/standard/php_smart_str.h
parent50dc2ec46cc59fef176f2e0d37450c84f3b70e64 (diff)
downloadphp-git-9e96c912fc7f6b5fec72521fe4a560fcab0478b9.tar.gz
Fixed smart_str0 for empty str(more friendly for user?)
Diffstat (limited to 'ext/standard/php_smart_str.h')
-rw-r--r--ext/standard/php_smart_str.h2
1 files changed, 2 insertions, 0 deletions
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)