Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-12-17 11:35:09 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2016-12-17 11:43:07 +0300
commit70c4d9bac261ca2101b1213e85a6d262499e19c9 (patch)
tree8c2c132efd306d72f0d89680684d8c2c3b7431d7 /library.h
parent205c47dfa454fbcc28d011947ed5549bc361fc29 (diff)
Fix broken REDIS_DOUBLE_TO_STRING implementation
Diffstat (limited to 'library.h')
-rw-r--r--library.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/library.h b/library.h
index 8eb67083..9f9b6b94 100644
--- a/library.h
+++ b/library.h
@@ -88,19 +88,17 @@ PHP_REDIS_API void redis_client_list_reply(INTERNAL_FUNCTION_PARAMETERS, RedisSo
#if ZEND_MODULE_API_NO >= 20100000
#define REDIS_DOUBLE_TO_STRING(dbl_str, dbl) do { \
char dbl_decsep = '.'; \
- zend_string _zstr = {0}; \
- _zstr.val = _php_math_number_format_ex(dbl, 16, &dbl_decsep, 1, NULL, 0); \
- _zstr.len = strlen(_zstr.val); \
- _zstr.gc = 0x10; \
- dbl_str = &_zstr; \
+ dbl_str = emalloc(sizeof(zend_string)); \
+ dbl_str->val = _php_math_number_format_ex(dbl, 16, &dbl_decsep, 1, NULL, 0); \
+ dbl_str->len = strlen(dbl_str->val); \
+ dbl_str->gc = 0x11; \
} while (0);
#else
#define REDIS_DOUBLE_TO_STRING(dbl_str, dbl) do { \
- zend_string _zstr = {0}; \
- _zstr.val = _php_math_number_format(dbl, 16, '.', '\x00'); \
- _zstr.len = strlen(_zstr.val); \
- _zstr.gc = 0x10; \
- dbl_str = &_zstr; \
+ dbl_str = emalloc(sizeof(zend_string)); \
+ dbl_str->val = _php_math_number_format(dbl, 16, '.', '\x00'); \
+ dbl_str->len = strlen(dbl_str->val); \
+ dbl_str->gc = 0x11; \
} while (0)
#endif
#else