iliaa           Fri Mar  6 15:48:30 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mbstring       mbstring.c 
  Log:
  
  Improve parameter parsing code
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.50&r2=1.224.2.22.2.25.2.51&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.50 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.51
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.50        Tue Feb 17 
16:29:59 2009
+++ php-src/ext/mbstring/mbstring.c     Fri Mar  6 15:48:30 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.25.2.50 2009/02/17 16:29:59 moriyoshi Exp $ 
*/
+/* $Id: mbstring.c,v 1.224.2.22.2.25.2.51 2009/03/06 15:48:30 iliaa Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -2279,7 +2279,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;
@@ -2295,7 +2295,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);
@@ -2323,9 +2323,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

Reply via email to