summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorIan M. <ian@aptel.org>2026-10-04 21:58:13 +0000
committerIan M. <ian@aptel.org>2026-10-04 21:58:13 +0000
commit90dd33afc65e6d5ffd8bad7905bd3280ebf53620 (patch)
tree40fe387d147ef8f2ee3aa6ad4a7a6edeb66e53f4 /core
parent0313c8e11ee3c85b232dc07729026de5625cce39 (diff)
lexer: Ensure byte is not EOF
Signed-off-by: Ian M. <ian@aptel.org>
Diffstat (limited to 'core')
-rw-r--r--core/lexer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/lexer.c b/core/lexer.c
index 019724c..53a418d 100644
--- a/core/lexer.c
+++ b/core/lexer.c
@@ -45,7 +45,10 @@ lexer_scan_byte(struct atas_state *state, bool skip_ws)
return '\0';
}
- c = fgetc(state->in_file);
+ if ((c = fgetc(state->in_file)) == EOF) {
+ return '\0';
+ }
+
while (lexer_is_ws(c) && skip_ws) {
if ((c = fgetc(state->in_file)) == EOF) {
return '\0';