com php-src: Fixed smart_str0 for empty str(more friendly for user?): ext/standard/php_smart_str .h
| From: | Dmitry Stogov | Date: | Mon, 24 Mar 2014 06:06:35 +0000 |
| Subject: | com php-src: Fixed smart_str0 for empty str(more friendly for user?): ext/standard/php_smart_str .h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77589@lists.php.net to get a copy of this message | ||
Commit: 9e96c912fc7f6b5fec72521fe4a560fcab0478b9
Author: Xinchen Hui <laruence@gmail.com> Mon, 24 Mar 2014 14:06:35 +0800
Parents: 50dc2ec46cc59fef176f2e0d37450c84f3b70e64
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9e96c912fc7f6b5fec72521fe4a560fcab0478b9
Log:
Fixed smart_str0 for empty str(more friendly for user?)
Changed paths:
M ext/standard/php_smart_str.h
Diff:
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h
index e11eb73..283d3eb 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)