summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c5
-rw-r--r--src/setup.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 28f897f..e4b0cbc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -451,7 +451,10 @@ static int print_setup_as_args(setup_t *setup, int wait)
if (r < 0)
goto _out_video;
- (void) fgets(buf, sizeof(buf), stdin);
+ if (fgets(buf, sizeof(buf), stdin) == NULL) {
+ r = -EBADF;
+ goto _out_video;
+ }
}
_out_video:
diff --git a/src/setup.c b/src/setup.c
index 7b5cecb..95387e3 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -146,7 +146,8 @@ int setup_interactively(til_settings_t *settings, int (*setup_func)(const til_se
if (feof(stdin))
return -EIO;
- (void) fgets(buf, sizeof(buf), stdin);
+ if (fgets(buf, sizeof(buf), stdin) == NULL)
+ return -EIO;
}
if (*buf == '\n') {
© All Rights Reserved