mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
size_t is unsigned and can't be negative
This commit is contained in:
parent
a5718539b1
commit
ddac2852dc
1 changed files with 1 additions and 1 deletions
|
@ -2884,7 +2884,7 @@ SPL_METHOD(SplFileObject, fwrite)
|
||||||
|
|
||||||
if (ZEND_NUM_ARGS() > 1) {
|
if (ZEND_NUM_ARGS() > 1) {
|
||||||
if (length >= 0) {
|
if (length >= 0) {
|
||||||
str_len = MAX(0, MIN((size_t)length, str_len));
|
str_len = MIN((size_t)length, str_len);
|
||||||
} else {
|
} else {
|
||||||
/* Negative length given, nothing to write */
|
/* Negative length given, nothing to write */
|
||||||
str_len = 0;
|
str_len = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue