]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
* libmisc/mail.c: Added brackets and parenthesis.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Aug 2008 18:31:56 +0000 (18:31 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Aug 2008 18:31:56 +0000 (18:31 +0000)
* libmisc/mail.c: Avoid assignments in comparisons.

ChangeLog
libmisc/mail.c

index 668703d716e6b180cdc8158dbe6fad8dbb774857..19fbcbc7c08049225a2d3e1f568ca90484b2db5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-26  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/mail.c: Added brackets and parenthesis.
+       * libmisc/mail.c: Avoid assignments in comparisons.
+
 2008-08-26  Tobias  <tp@fonz.de>
 
        * NEWS: Added support for uclibc.
index 42643c23bd90f23f365fb883f66113e30cb171f2..e75032a0882d8074f4dd7efe9b89e52324a4e743 100644 (file)
@@ -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."));
+       }
 }
+