Skip to content

Commit

Permalink
Drop redundant arg count check
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Aug 13, 2020
1 parent 45d69fb commit 90330a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions ext/standard/formatted_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,10 +866,6 @@ PHP_FUNCTION(fprintf)
int argc;
zend_string *result;

if (ZEND_NUM_ARGS() < 2) {
WRONG_PARAM_COUNT;
}

ZEND_PARSE_PARAMETERS_START(2, -1)
Z_PARAM_RESOURCE(arg1)
Z_PARAM_STRING(format, format_len)
Expand Down Expand Up @@ -901,10 +897,6 @@ PHP_FUNCTION(vfprintf)
int argc;
zend_string *result;

if (ZEND_NUM_ARGS() != 3) {
WRONG_PARAM_COUNT;
}

ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_RESOURCE(arg1)
Z_PARAM_STRING(format, format_len)
Expand Down
6 changes: 3 additions & 3 deletions ext/standard/tests/strings/fprintf_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ echo "Done\n";
?>
--EXPECT--
*** Testing Error Conditions ***
Wrong parameter count for fprintf()
Wrong parameter count for fprintf()
Wrong parameter count for fprintf()
fprintf() expects at least 2 parameters, 0 given
fprintf() expects at least 2 parameters, 1 given
fprintf() expects at least 2 parameters, 1 given
Done
4 changes: 2 additions & 2 deletions ext/standard/tests/strings/vfprintf_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ unlink( $file );
?>
--EXPECT--
-- Testing vfprintf() function with more than expected no. of arguments --
Wrong parameter count for vfprintf()
Wrong parameter count for vfprintf()
vfprintf() expects exactly 3 parameters, 4 given
vfprintf() expects exactly 3 parameters, 4 given

0 comments on commit 90330a4

Please sign in to comment.