From d8aad16dd04d7d75747166885d7e357e79a231a6 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 1 Jul 2008 10:01:25 +0000 Subject: [PATCH] Use new parameter parsing API --- ext/standard/formatted_print.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b6ec457177..d8d1fb88b0 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -669,16 +669,13 @@ static char * php_formatted_print(int ht, int *len, int use_array, int format_of char *format, *result, padding; int always_sign; - argc = ZEND_NUM_ARGS(); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + return NULL; + } /* verify the number of args */ if ((use_array && argc != (2 + format_offset)) || (!use_array && argc < (1 + format_offset))) { - WRONG_PARAM_COUNT_WITH_RETVAL(NULL); - } - args = (zval ***)safe_emalloc(argc, sizeof(zval *), 0); - - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { efree(args); WRONG_PARAM_COUNT_WITH_RETVAL(NULL); } -- 2.50.1