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

index 2d81fae2a568350f21cb348e9a7a388cd5213ec4..5d023da1ab3e8a66811a41ac80d9bb10102beb4d 100644 (file)
@@ -379,16 +379,13 @@ php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC
        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);
        }
index 5fe3ff144228fa7335f8d4b27e51b7157fca0d8b..ccc37407e82b4b26d74f6bab31f42bc940c0e4fd 100644 (file)
@@ -20,12 +20,12 @@ echo "Done\n";
 --EXPECTF--
 *** Testing Error Conditions ***
 
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
 NULL
 
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
 NULL
 
-Warning: fprintf() expects at least %d parameters, %d given in %s on line %d
+Warning: Wrong parameter count for fprintf() in %sfprintf_error.php on line %d
 NULL
 Done