summaryrefslogtreecommitdiff
path: root/src/basic/terminal-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-19 15:09:53 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-19 15:09:53 +0100
commit5f0f8d749db5f005f72978a31959be4bfe46b495 (patch)
tree7660d999c461b712e4d825862cb812c0feaab476 /src/basic/terminal-util.c
parentbcbd1d0cd5a1e6ff068f251c99ed7905223fed67 (diff)
parentb3b0c23a56a2506a0d181af2f1775e3a98966c49 (diff)
Merge pull request #2357 from keszybz/warnings-2
Remove gcc warnings v2
Diffstat (limited to 'src/basic/terminal-util.c')
-rw-r--r--src/basic/terminal-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index a39764472b..7c9de72bb7 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -128,7 +128,7 @@ int read_one_char(FILE *f, char *ret, usec_t t, bool *need_nl) {
errno = 0;
if (!fgets(line, sizeof(line), f))
- return errno ? -errno : -EIO;
+ return errno > 0 ? -errno : -EIO;
truncate_nl(line);
@@ -212,7 +212,7 @@ int ask_string(char **ret, const char *text, ...) {
errno = 0;
if (!fgets(line, sizeof(line), stdin))
- return errno ? -errno : -EIO;
+ return errno > 0 ? -errno : -EIO;
if (!endswith(line, "\n"))
putchar('\n');