From f2f23168dbf5002660fa6b252a55ad79b5746993 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Mon, 23 Nov 2020 07:06:35 -0500 Subject: don't ignore return value from function Signed-off-by: Thanos Makatos --- samples/null.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'samples') diff --git a/samples/null.c b/samples/null.c index caec23f..2dd1bdd 100644 --- a/samples/null.c +++ b/samples/null.c @@ -92,7 +92,9 @@ int main(int argc, char **argv) } printf("press enter to stop device emulation and clean up\n"); - getchar(); + if (getchar() == EOF) { + err(EXIT_FAILURE, NULL); + } ret = pthread_cancel(thread); if (ret != 0) { @@ -102,7 +104,9 @@ int main(int argc, char **argv) lm_ctx_destroy(lm_ctx); printf("device emulation stopped and cleaned up, press enter to exit\n"); - getchar(); + if (getchar() == EOF) { + err(EXIT_FAILURE, NULL); + } return ret; } -- cgit v1.1