From cf4aea18b4802df59dc10532537ba54784d04ff3 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 30 Aug 2008 18:31:56 +0000 Subject: [PATCH] * libmisc/mail.c: Added brackets and parenthesis. * libmisc/mail.c: Avoid assignments in comparisons. --- ChangeLog | 5 +++++ libmisc/mail.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 668703d7..19fbcbc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-26 Nicolas François + + * libmisc/mail.c: Added brackets and parenthesis. + * libmisc/mail.c: Avoid assignments in comparisons. + 2008-08-26 Tobias * NEWS: Added support for uclibc. diff --git a/libmisc/mail.c b/libmisc/mail.c index 42643c23..e75032a0 100644 --- a/libmisc/mail.c +++ b/libmisc/mail.c @@ -47,8 +47,9 @@ void mailcheck (void) struct stat statbuf; char *mailbox; - if (!getdef_bool ("MAIL_CHECK_ENAB")) + if (!getdef_bool ("MAIL_CHECK_ENAB")) { return; + } /* * Check incoming mail in Maildir format - J. @@ -69,13 +70,18 @@ void mailcheck (void) free (newmail); } - if (!(mailbox = getenv ("MAIL"))) + mailbox = getenv ("MAIL"); + if (NULL == mailbox) { return; + } - if (stat (mailbox, &statbuf) == -1 || statbuf.st_size == 0) + if ( (stat (mailbox, &statbuf) == -1) + || (statbuf.st_size == 0)) { puts (_("No mail.")); - else if (statbuf.st_atime > statbuf.st_mtime) + } else if (statbuf.st_atime > statbuf.st_mtime) { puts (_("You have mail.")); - else + } else { puts (_("You have new mail.")); + } } +