From: Ilia Alshanetsky Date: Tue, 29 Aug 2006 19:50:04 +0000 (+0000) Subject: Corrected problems introduced by previous commit. X-Git-Tag: php-5.2.0RC3~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b9e18d4713a030bce3a1c93e98e636f63538fda;p=php Corrected problems introduced by previous commit. # Issue found by Stefan --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 9bb8304b8e..2de5d03a4f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -905,7 +905,7 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) case IS_LONG: { char stmp[MAX_LENGTH_OF_LONG + 1]; - str_len = snprintf(stmp, sizeof(stmp), "%ld", Z_LVAL_PP(tmp)); + str_len = sprintf(stmp, "%ld", Z_LVAL_PP(tmp)); smart_str_appendl(&implstr, stmp, str_len); } break; @@ -920,10 +920,10 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) break; case IS_DOUBLE: { - char *stmp = (char *) do_alloca(MAX_LENGTH_OF_DOUBLE + EG(precision) + 2); /* +1 for decimal point */ - str_len = snprintf(stmp, sizeof(stmp), "%.*G", (int) EG(precision), Z_DVAL_PP(tmp)); + char *stmp; + str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_PP(tmp)); smart_str_appendl(&implstr, stmp, str_len); - free_alloca(stmp); + efree(stmp); } break;