diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-08-29 19:50:04 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-08-29 19:50:04 +0000 |
| commit | 1b9e18d4713a030bce3a1c93e98e636f63538fda (patch) | |
| tree | 6d252fe98f767a4076749ae38e9883dd2cb39c12 | |
| parent | 5ea308054639da733bb3e2d573065dc56b6d2de1 (diff) | |
| download | php-git-1b9e18d4713a030bce3a1c93e98e636f63538fda.tar.gz | |
Corrected problems introduced by previous commit.
# Issue found by Stefan
| -rw-r--r-- | ext/standard/string.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |
