summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index d18fffa..ad32293 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -813,6 +813,9 @@ tok_readline_raw(struct tok_state *tok)
tok_concatenate_interactive_new_line(tok, line) == -1) {
return 0;
}
+ if (*tok->inp == '\0') {
+ return 0;
+ }
tok->inp = strchr(tok->inp, '\0');
} while (tok->inp[-1] != '\n');
return 1;
@@ -963,7 +966,7 @@ tok_underflow_file(struct tok_state *tok) {
if (tok->lineno > 2) {
tok->decoding_state = STATE_NORMAL;
}
- else if (!check_coding_spec(tok->cur, tok->end - tok->cur,
+ else if (!check_coding_spec(tok->cur, strlen(tok->cur),
tok, fp_setreadl))
{
return 0;