mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
switch to smart str conversion routine to hide exact NAN type
see https://github.com/php/php-src/pull/2356#issuecomment-277564135
This commit is contained in:
parent
8a8aa67844
commit
fd521a22f7
1 changed files with 2 additions and 2 deletions
|
@ -556,8 +556,8 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
|
||||||
break;
|
break;
|
||||||
case IS_DOUBLE: {
|
case IS_DOUBLE: {
|
||||||
double dval = Z_DVAL_P(arg);
|
double dval = Z_DVAL_P(arg);
|
||||||
char *s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
|
char *s_tmp;
|
||||||
int l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
|
size_t l_tmp = zend_spprintf(&s_tmp, MAX_LENGTH_OF_DOUBLE + EG(precision) + 1, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||||
smart_str_appendl(str, s_tmp, l_tmp);
|
smart_str_appendl(str, s_tmp, l_tmp);
|
||||||
smart_str_appends(str, ", ");
|
smart_str_appends(str, ", ");
|
||||||
efree(s_tmp);
|
efree(s_tmp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue