diff options
-rw-r--r-- | ext/standard/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 96509040b3..1c5aed7eb2 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1044,7 +1044,7 @@ PHPAPI PHP_FUNCTION(fgets) } /* resize buffer if it's much larger than the result. * Only needed if the user requested a buffer size. */ - if (line_len < len / 2) { + if (line_len < (size_t)len / 2) { str = zend_string_truncate(str, line_len, 0); } else { ZSTR_LEN(str) = line_len; |