summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 1846439e74..d9db617855 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -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:
@@ -651,30 +647,6 @@ ZEND_METHOD(exception, getPrevious)
ZVAL_COPY(return_value, GET_PROPERTY_SILENT(getThis(), ZEND_STR_PREVIOUS));
} /* }}} */
-size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) /* {{{ */
-{
- va_list arg;
- size_t len;
-
- va_start(arg, format);
- len = zend_vspprintf(message, max_len, format, arg);
- va_end(arg);
- return len;
-}
-/* }}} */
-
-zend_string *zend_strpprintf(size_t max_len, const char *format, ...) /* {{{ */
-{
- va_list arg;
- zend_string *str;
-
- va_start(arg, format);
- str = zend_vstrpprintf(max_len, format, arg);
- va_end(arg);
- return str;
-}
-/* }}} */
-
/* {{{ proto string Exception|Error::__toString()
Obtain the string representation of the Exception object */
ZEND_METHOD(exception, __toString)
@@ -963,7 +935,7 @@ ZEND_API ZEND_COLD zend_object *zend_throw_error_exception(zend_class_entry *exc
}
/* }}} */
-static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...) /* {{{ */
+static void zend_error_va(int type, const char *file, uint32_t lineno, const char *format, ...) /* {{{ */
{
va_list args;
@@ -973,7 +945,7 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
}
/* }}} */
-static void zend_error_helper(int type, const char *filename, const uint lineno, const char *format, ...) /* {{{ */
+static void zend_error_helper(int type, const char *filename, const uint32_t lineno, const char *format, ...) /* {{{ */
{
va_list va;