diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2009-03-06 15:48:54 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2009-03-06 15:48:54 +0000 |
| commit | 2c5716c3c24be5ed5fecc2f50aefb1d21a59bccb (patch) | |
| tree | 8b5f608151fcd1d71511619cadb4e553c4d22cb8 | |
| parent | 3d7434b512ad33d050e6af30304515036aa35cdb (diff) | |
| download | php-git-2c5716c3c24be5ed5fecc2f50aefb1d21a59bccb.tar.gz | |
MFB: Improve parameter parsing code
| -rw-r--r-- | ext/mbstring/mbstring.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 6aed0db646..6f9f0942e9 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2117,7 +2117,7 @@ PHP_FUNCTION(mb_strrpos) mbfl_string haystack, needle; char *enc_name = NULL; int enc_name_len; - zval **zoffset; + zval **zoffset = NULL; long offset = 0, str_flg; char *enc_name2 = NULL; int enc_name_len2; @@ -2133,7 +2133,7 @@ PHP_FUNCTION(mb_strrpos) RETURN_FALSE; } - if(ZEND_NUM_ARGS() >= 3) { + if (zoffset) { if (Z_TYPE_PP(zoffset) == IS_STRING) { enc_name2 = Z_STRVAL_PP(zoffset); enc_name_len2 = Z_STRLEN_PP(zoffset); @@ -2161,9 +2161,9 @@ PHP_FUNCTION(mb_strrpos) } } - if(str_flg) { - convert_to_long_ex(zoffset); - offset = Z_LVAL_PP(zoffset); + if (str_flg) { + convert_to_long_ex(zoffset); + offset = Z_LVAL_PP(zoffset); } else { enc_name = enc_name2; enc_name_len = enc_name_len2; |
