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:
Anatol Belski 2017-02-07 12:01:14 +01:00
parent 8a8aa67844
commit fd521a22f7

View file

@ -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);