From 9e96c912fc7f6b5fec72521fe4a560fcab0478b9 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 24 Mar 2014 14:06:35 +0800 Subject: [PATCH] Fixed smart_str0 for empty str(more friendly for user?) --- ext/standard/php_smart_str.h | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.50.1