iliaa Fri Mar 6 15:48:55 2009 UTC
Modified files:
/php-src/ext/mbstring mbstring.c
Log:
MFB: Improve parameter parsing code
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.317&r2=1.318&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.317
php-src/ext/mbstring/mbstring.c:1.318
--- php-src/ext/mbstring/mbstring.c:1.317 Tue Feb 17 16:28:33 2009
+++ php-src/ext/mbstring/mbstring.c Fri Mar 6 15:48:54 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.317 2009/02/17 16:28:33 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.318 2009/03/06 15:48:54 iliaa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -2117,7 +2117,7 @@
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 @@
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 @@
}
}
- 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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php