mirror of
https://github.com/NickHu/sway
synced 2025-01-28 07:58:22 +01:00
Fix condition in peek_line
This commit is contained in:
parent
8bfa2def88
commit
fbca3bbacb
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ char *peek_line(FILE *file, int offset, long *position) {
|
||||||
if (read < 0) {
|
if (read < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (line[read - 1] == '\n') {
|
if (read > 0 && line[read - 1] == '\n') {
|
||||||
line[read - 1] = '\0';
|
line[read - 1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue