]> granicus.if.org Git - php/commitdiff
rework fd521a22 to simplify for master, see github #2356
authorAnatol Belski <ab@php.net>
Tue, 7 Feb 2017 11:40:10 +0000 (12:40 +0100)
committerAnatol Belski <ab@php.net>
Tue, 7 Feb 2017 11:40:10 +0000 (12:40 +0100)
Zend/zend_exceptions.c

index ea38f67de64ad399098697d1e69339994b3985b5..d9db617855ca9e45a1fe5fc0889d726bea53f514 100644 (file)
@@ -520,12 +520,8 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
                        smart_str_appends(str, ", ");
                        break;
                case IS_DOUBLE: {
-                       double dval = Z_DVAL_P(arg);
-                       char *s_tmp;
-                       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_append_printf(str, "%.*G", (int) EG(precision), Z_DVAL_P(arg));
                        smart_str_appends(str, ", ");
-                       efree(s_tmp);
                        break;
                }
                case IS_ARRAY: