From ddac2852dc577c1f244bcdf1c665aacdff48637e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 29 Apr 2016 12:23:30 +0300 Subject: [PATCH] size_t is unsigned and can't be negative --- ext/spl/spl_directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.40.0