From d3f87d0ffce0cf95ede8fea237315985f6f5eee9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 22 Aug 2013 08:45:08 -0700 Subject: [PATCH] adapted the function args for ereg And that actually seems to be it, all tests pass so far. So lets see how it goes in the fture, too easy but seems to be done for now . --- ext/ereg/ereg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index b2e64267e9..d958d0c773 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -291,7 +291,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) zval **regex, /* Regular expression */ **array = NULL; /* Optional register array */ char *findin; /* String to apply expression to */ - int findin_len; + zend_str_size_int findin_len; regex_t re; regmatch_t *subs; int err, match_len, string_len; @@ -302,7 +302,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) char *string = NULL; int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc TSRMLS_CC, "Zs|Z", ®ex, &findin, &findin_len, &array) == FAILURE) { + if (zend_parse_parameters(argc TSRMLS_CC, "ZS|Z", ®ex, &findin, &findin_len, &array) == FAILURE) { return; } @@ -555,9 +555,9 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase) char *string; char *replace; char *ret; - int arg_string_len; + zend_str_size_int arg_string_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZs", &arg_pattern, &arg_replace, &arg_string, &arg_string_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZS", &arg_pattern, &arg_replace, &arg_string, &arg_string_len) == FAILURE) { return; } @@ -632,10 +632,10 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase) regex_t re; regmatch_t subs[1]; char *spliton, *str, *strp, *endp; - int spliton_len, str_len; + zend_str_size_int spliton_len, str_len; int err, size, copts = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) { return; } @@ -731,11 +731,11 @@ PHP_FUNCTION(spliti) PHP_EREG_API PHP_FUNCTION(sql_regcase) { char *string, *tmp; - int string_len; + zend_str_size_int string_len; unsigned char c; register int i, j; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &string_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &string, &string_len) == FAILURE) { return; }