]> granicus.if.org Git - php/commitdiff
Simplify parameter parsing
authorIlia Alshanetsky <iliaa@php.net>
Thu, 8 Jan 2009 00:37:39 +0000 (00:37 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 8 Jan 2009 00:37:39 +0000 (00:37 +0000)
ext/ereg/ereg.c

index 3df5f00ccc3d51df32ee1ff28e5f2e2595f04a0c..ed9dfaec2b7b21794fd6252a96732ecf6e9df546 100644 (file)
@@ -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;
        }