From e6b21e1a510691a86dcc1ecdf71a80a7c62ff17f Mon Sep 17 00:00:00 2001 From: Sven-Haegar Koch Date: Sat, 28 May 2011 03:48:07 +0200 Subject: [PATCH] fgets() returns NULL on error, not < 0 --- src/tincctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tincctl.c b/src/tincctl.c index 5477fd0e..ef5233c5 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -159,7 +159,7 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) { what, filename); fflush(stdout); - if(fgets(buf, sizeof buf, stdin) < 0) { + if(fgets(buf, sizeof buf, stdin) == NULL) { fprintf(stderr, "Error while reading stdin: %s\n", strerror(errno)); return NULL; -- 2.39.5