From c986aa6346110fe592a7e165c22cf99142fe28b6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Sun, 20 Dec 2009 02:49:47 +0100 Subject: [PATCH] fix unused result warnings in mail.c --- src/mail.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mail.c b/src/mail.c index f5be56be..3e8c998c 100644 --- a/src/mail.c +++ b/src/mail.c @@ -323,7 +323,8 @@ static void update_mail_count(struct local_mail_s *mail) /* skip until \n */ while (strchr(buf, '\n') == NULL && !feof(fp)) { - fgets(buf, 128, fp); + if (!fgets(buf, 128, fp)) + break; } } @@ -431,7 +432,8 @@ struct mail_s *parse_mail_args(char type, const char *arg) term.c_lflag &= ~ECHO; tcsetattr(fp, TCSANOW, &term); printf("Enter mailbox password (%s@%s): ", mail->user, mail->host); - scanf("%128s", mail->pass); + if (scanf("%128s", mail->pass)) + mail->pass[0] = 0; printf("\n"); term.c_lflag |= ECHO; tcsetattr(fp, TCSANOW, &term);