diff options
author | Antony Dovgal <tony2001@php.net> | 2006-08-29 12:20:18 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-08-29 12:20:18 +0000 |
commit | ffc3d4a0760be607ac299068d65fec8a889ba5c9 (patch) | |
tree | be2e482cbb1094ab6697eab9f4ff2d4859fab0d4 | |
parent | 664a7c75d4fbe6b190cfac69010303f6b2afbe3a (diff) | |
download | php-git-ffc3d4a0760be607ac299068d65fec8a889ba5c9.tar.gz |
fix win32 build
EG(precision) can be changed in runtime, even in php_implode() (hint: __toString()), so please think twice before optimizing
-rw-r--r-- | ext/standard/string.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index f5851fa87d..8e5fb6f819 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -920,9 +920,11 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) break; case IS_DOUBLE: { - char stmp[MAX_LENGTH_OF_DOUBLE + EG(precision) + 1]; + char *stmp; + stmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); str_len = sprintf(stmp, "%.*G", (int) EG(precision), Z_DVAL_PP(tmp)); smart_str_appendl(&implstr, stmp, str_len); + efree(stmp); } break; |