Skip to content

Commit 63a75e6

Browse files
committed
fix: throw exception if bufferSize is below 1
1 parent 91a1bd6 commit 63a75e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Components/LineReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private static function readBackwards($fh, int $pos): \Generator
100100
$pos -= $bufferSize;
101101
}
102102
fseek($fh, $pos);
103-
if ($bufferSize < 0) {
103+
if ($bufferSize < 1) {
104104
throw new \RuntimeException('Buffer size cannot be negative');
105105
}
106106
$chunk = fread($fh, $bufferSize);

0 commit comments

Comments
 (0)