diff options
Diffstat (limited to 'ext/standard/sha1.c')
| -rw-r--r-- | ext/standard/sha1.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index b3341cb8e6..5616999c71 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -40,9 +40,11 @@ PHP_FUNCTION(sha1) PHP_SHA1_CTX context; unsigned char digest[20]; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_STR(arg) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(raw_output) + ZEND_PARSE_PARAMETERS_END(); sha1str[0] = '\0'; PHP_SHA1Init(&context); @@ -74,9 +76,11 @@ PHP_FUNCTION(sha1_file) size_t n; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) { - return; - } + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_PATH(arg, arg_len) + Z_PARAM_OPTIONAL + Z_PARAM_BOOL(raw_output) + ZEND_PARSE_PARAMETERS_END(); stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL); if (!stream) { |
