Commit 26d998cf authored by Benjamin Peterson's avatar Benjamin Peterson

properly handle the single null-byte file (closes #24022)

parent 354c2f90
......@@ -1014,7 +1014,7 @@ tok_nextc(struct tok_state *tok)
else {
tok->done = E_OK;
tok->inp = strchr(tok->buf, '\0');
done = tok->inp[-1] == '\n';
done = tok->inp == tok->buf || tok->inp[-1] == '\n';
}
}
else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment