size_t is unsigned and can't be negative

This commit is contained in:
Dmitry Stogov 2016-04-29 12:23:30 +03:00
parent a5718539b1
commit ddac2852dc

View file

@ -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;