Avoid ?: construct without the middle term.

This commit is contained in:
nekral-guest 2008-01-01 14:34:07 +00:00
parent 72713d0b73
commit d0de685c7a
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Avoid ?: construct without the middle term.
2008-01-01 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/copydir.c, src/usermod.c, lib/prototypes.h: The uid and

View File

@ -1535,7 +1535,10 @@ static void create_mail (void)
mode_t mode;
if (strcasecmp (create_mail_spool, "yes") == 0) {
spool = getdef_str ("MAIL_DIR") ? : "/var/mail";
spool = getdef_str ("MAIL_DIR");
if (NULL == spool) {
spool = "/var/mail";
}
file = alloca (strlen (spool) + strlen (user_name) + 2);
sprintf (file, "%s/%s", spool, user_name);
fd = open (file, O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 0);