com php-src: fix warnings and datatype: ext/mbstring/mbstring.c

From: Date: Sun, 23 Jul 2017 15:36:10 +0000
Subject: com php-src: fix warnings and datatype: ext/mbstring/mbstring.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98756@lists.php.net to get a copy of this message
Commit: 6809be20902bf83a9d21e9658b07d3365557ffe6 Author: Anatol Belski <ab@php.net> Sun, 23 Jul 2017 17:33:18 +0200 Parents: 7496bad2ace2be2c0d967f7afefd6e9c8e96af79 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6809be20902bf83a9d21e9658b07d3365557ffe6 Log: fix warnings and datatype ident Changed paths: M ext/mbstring/mbstring.c Diff: diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 9f96bc9..561794c 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -4971,8 +4971,7 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char* const mbfl_encoding *enc; enum mbfl_no_encoding no_enc; char* ret; - size_t ret_len; - unsigned char char_len; + size_t ret_len, char_len; zend_long cp; enc = php_mb_get_encoding(enc_name); @@ -5429,16 +5428,16 @@ MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t ol size_t haystack_char_len = mbfl_strlen(&haystack); if (mode) { - if ((offset > 0 && offset > haystack_char_len) || - (offset < 0 && -offset > haystack_char_len)) { + if ((offset > 0 && (size_t)offset > haystack_char_len) || + (offset < 0 && (size_t)(-offset) > haystack_char_len)) { php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string"); break; } } else { if (offset < 0) { - offset += (long)haystack_char_len; + offset += (zend_long)haystack_char_len; } - if (offset < 0 || offset > haystack_char_len) { + if (offset < 0 || (size_t)offset > haystack_char_len) { php_error_docref(NULL, E_WARNING, "Offset not contained in string"); break; }

« previous php.cvs (#98756) next »