From b5ce669de50e9f001f38f268374e18bcb14b43fa Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Sat, 25 Apr 2020 19:24:07 +0200 Subject: [PATCH] fgets error --- src/frontend/inp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 1e2218f6e..bbb7cbac5 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1390,8 +1390,7 @@ com_edit(wordlist *wl) fprintf(cp_out, "run circuit? "); fflush(cp_out); - fgets(buf, BSIZE_SP, stdin); - if (buf[0] != 'n') { + if (fgets(buf, BSIZE_SP, stdin) == (char *) NULL || buf[0] != 'n') { fprintf(cp_out, "running circuit\n"); com_run(NULL); }