Skip to content

Commit

Permalink
fix: throw exception if bufferSize is below 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tinect committed Dec 28, 2024
1 parent 91a1bd6 commit 63a75e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Components/LineReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static function readBackwards($fh, int $pos): \Generator
$pos -= $bufferSize;
}
fseek($fh, $pos);
if ($bufferSize < 0) {
if ($bufferSize < 1) {
throw new \RuntimeException('Buffer size cannot be negative');
}
$chunk = fread($fh, $bufferSize);
Expand Down

0 comments on commit 63a75e6

Please sign in to comment.