From 11ffd33053b157e3ee70b46080501fa637c0f84d Mon Sep 17 00:00:00 2001 From: Nakidai Date: Wed, 26 Mar 2025 21:02:40 +0300 Subject: Allow EOF --- executor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor.c b/executor.c index 993870a..0542a9c 100644 --- a/executor.c +++ b/executor.c @@ -220,7 +220,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab errx(1, "Cannot save input in a non-existent variable %c", code->value); int c = getchar(); - if (c < 0) + if (c < 0 && ferror(stdin)) err(1, "getchar()"); *p = c; -- cgit 1.4.1