From: Anatol Belski Date: Tue, 25 Jul 2017 17:02:50 +0000 (+0200) Subject: size_t fixes X-Git-Tag: php-7.3.0alpha1~1786^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13a26290054fa9036abef37889bc678791935232;p=php size_t fixes --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 4f3b7dc08e..cb5fb053ea 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1347,7 +1347,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output) /* }}} */ /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */ -int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length) +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, size_t new_value_length) { const mbfl_encoding *encoding; @@ -2932,7 +2932,7 @@ PHP_FUNCTION(mb_strcut) } } - if ((unsigned int)from > string.len) { + if (from > string.len) { RETURN_FALSE; } @@ -4469,7 +4469,7 @@ PHP_FUNCTION(mb_send_mail) /* message body */ orig_str.no_language = MBSTRG(language); orig_str.val = (unsigned char *)message; - orig_str.len = (unsigned int)message_len; + orig_str.len = message_len; orig_str.encoding = MBSTRG(current_internal_encoding); if (orig_str.encoding->no_encoding == mbfl_no_encoding_invalid diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 6d04072506..1b8e618af5 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -157,7 +157,7 @@ MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t ol MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const char *enc); /* internal use only */ -int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length); +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, size_t new_value_length); ZEND_BEGIN_MODULE_GLOBALS(mbstring) char *internal_encoding_name;