com php-src: size_t is unsigned and can't be ne gative: ext/spl/spl_directory.c
| From: | Dmitry Stogov | Date: | Fri, 29 Apr 2016 09:23:30 +0000 |
| Subject: | com php-src: size_t is unsigned and can't be ne gative: ext/spl/spl_directory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91949@lists.php.net to get a copy of this message | ||
Commit: ddac2852dc577c1f244bcdf1c665aacdff48637e
Author: Dmitry Stogov <dmitry@zend.com> Fri, 29 Apr 2016 12:23:30 +0300
Parents: a5718539b16616bb23fb2897124733c0514454bd
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ddac2852dc577c1f244bcdf1c665aacdff48637e
Log:
size_t is unsigned and can't be negative
Changed paths:
M ext/spl/spl_directory.c
Diff:
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 412fc54..161fd12 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory..c
@@ -2884,7 +2884,7 @@ SPL_METHOD(SplFileObject, fwrite)
if (ZEND_NUM_ARGS() > 1) {
if (length >= 0) {
- str_len = MAX(0, MIN((size_t)length, str_len));
+ str_len = MIN((size_t)length, str_len);
} else {
/* Negative length given, nothing to write */
str_len = 0;