com php-src: redo the fix casting to size_t: ext/iconv/ic onv.c
| From: | Anatol Belski | Date: | Tue, 16 Sep 2014 19:17:21 +0000 |
| Subject: | com php-src: redo the fix casting to size_t: ext/iconv/ic onv.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81695@lists.php.net to get a copy of this message | ||
Commit: 95132bee40321f0cb128702b4154593113cd8273
Author: Anatol Belski <ab@php.net> Tue, 16 Sep 2014 12:53:25 +0200
Parents: 49a6b485a0173b855e31ce8dc7800ac1672b6981
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=95132bee40321f0cb128702b4154593113cd8273
Log:
redo the fix casting to size_t
Changed paths:
M ext/iconv/iconv.c
Diff:
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index ac2374c..490a926 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -824,16 +824,16 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
}
}
- if(len > (zend_long)total_len) {
+ if((size_t)len > total_len) {
len = total_len;
}
- if (offset >= (zend_long)total_len) {
+ if ((size_t)offset >= total_len) {
return PHP_ICONV_ERR_SUCCESS;
}
- if ((offset + len) > (zend_long)total_len ) {
+ if ((size_t)(offset + len) > total_len ) {
/* trying to compute the length */
len = total_len - offset;
}