]> granicus.if.org Git - php/commitdiff
redo the fix casting to size_t where applicable
authorAnatol Belski <ab@php.net>
Tue, 16 Sep 2014 10:48:15 +0000 (12:48 +0200)
committerAnatol Belski <ab@php.net>
Tue, 16 Sep 2014 19:17:19 +0000 (21:17 +0200)
ext/mbstring/mbstring.c
ext/mbstring/php_mbregex.c

index b2bceed426fdcc5111a3bb2792ffa83bf9a4fe0a..615381e6c459e1f6831ea83df07cfaf68bbd0b38 100644 (file)
@@ -2963,7 +2963,7 @@ PHP_FUNCTION(mb_strimwidth)
        string.val = (unsigned char *)str;
        string.len = str_len;
 
-       if (from < 0 || from > (zend_long)str_len) {
+       if (from < 0 || (size_t)from > str_len) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Start position is out of range");
                RETURN_FALSE;
        }
index d78131fff565c7e3645e1b61644dfaf8609504a4..864d50a5ceb4ae0513faa8243020b5a7f897300d 100644 (file)
@@ -1403,7 +1403,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
                return;
        }
 
-       if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && position >= (zend_long)Z_STRLEN(MBREX(search_str)))) {
+       if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range");
                MBREX(search_pos) = 0;
                RETURN_FALSE;