1
0
Fork 0
mirror of https://github.com/swaywm/sway.git synced 2025-03-20 13:29:33 +00:00

Fix condition in peek_line

This commit is contained in:
Brian Ashworth 2018-05-31 09:07:35 -04:00
parent 8bfa2def88
commit fbca3bbacb

View file

@ -58,7 +58,7 @@ char *peek_line(FILE *file, int offset, long *position) {
if (read < 0) {
break;
}
if (line[read - 1] == '\n') {
if (read > 0 && line[read - 1] == '\n') {
line[read - 1] = '\0';
}
}