1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00

Fix off-by-one error

This commit is contained in:
Brown 2019-04-17 14:07:17 -04:00
parent 1f36a85650
commit 1b4b7d416e

View File

@ -46,8 +46,8 @@ class FileManipulationBuffer
$bounds[0]--;
}
if ($file_contents[$bounds[1]] ?? null === PHP_EOL
&& $file_contents[$bounds[1] + 1] ?? null === PHP_EOL
if ($file_contents[$bounds[1] + 1] ?? null === PHP_EOL
&& $file_contents[$bounds[1] + 2] ?? null === PHP_EOL
) {
$bounds[1]++;
}