]> granicus.if.org Git - php/commitdiff
Use new parameter parsing API
authorDmitry Stogov <dmitry@php.net>
Tue, 1 Jul 2008 10:01:25 +0000 (10:01 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 1 Jul 2008 10:01:25 +0000 (10:01 +0000)
ext/standard/formatted_print.c

index b6ec457177fa094cbe86d684883315dc7049e466..d8d1fb88b0a3f3db963f29d93f1e77f84a153082 100644 (file)
@@ -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);
        }