From 9ce52853c78d4039b4fd728179c42f48f7429dd1 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 8 Jan 2009 00:37:39 +0000 Subject: Simplify parameter parsing --- ext/ereg/ereg.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'ext/ereg') diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 3df5f00ccc..ed9dfaec2b 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -578,22 +578,17 @@ PHP_FUNCTION(eregi_replace) */ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) { - long arg_count; + long count = -1; regex_t re; regmatch_t subs[1]; char *spliton, *str, *strp, *endp; int spliton_len, str_len; - int err, size, count = -1, copts = 0; - int argc = ZEND_NUM_ARGS(); + int err, size, copts = 0; - if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &arg_count) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) { return; } - if (argc > 2) { - count = arg_count; - } - if (icase) { copts = REG_ICASE; } -- cgit v1.2.1