mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
Use new parameter parsing API
This commit is contained in:
parent
c79df56ac6
commit
f7938051d4
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user