From: Anatol Belski Date: Tue, 16 Sep 2014 10:48:15 +0000 (+0200) Subject: redo the fix casting to size_t where applicable X-Git-Tag: POST_NATIVE_TLS_MERGE^2~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49a6b485a0173b855e31ce8dc7800ac1672b6981;p=php redo the fix casting to size_t where applicable --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index b2bceed426..615381e6c4 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -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; } diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index d78131fff5..864d50a5ce 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -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;