From: Dmitry Stogov Date: Fri, 29 Apr 2016 09:23:30 +0000 (+0300) Subject: size_t is unsigned and can't be negative X-Git-Tag: php-7.1.0alpha1~237^2~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddac2852dc577c1f244bcdf1c665aacdff48637e;p=php size_t is unsigned and can't be negative --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 412fc54324..161fd12268 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;