mirror of
https://github.com/sheumann/hush.git
synced 2025-01-14 12:30:40 +00:00
Treat NUL as the end-of-line.
This commit is contained in:
parent
66c22051f9
commit
355a61b56f
@ -45,7 +45,7 @@ extern char *get_line_from_file(FILE *file)
|
|||||||
while (idx > linebufsz-2)
|
while (idx > linebufsz-2)
|
||||||
linebuf = xrealloc(linebuf, linebufsz += GROWBY);
|
linebuf = xrealloc(linebuf, linebufsz += GROWBY);
|
||||||
linebuf[idx++] = (char)ch;
|
linebuf[idx++] = (char)ch;
|
||||||
if ((char)ch == '\n')
|
if (ch == '\n' || ch == '\0')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user