From d0de685c7a79a8fc857b3b33b0059feb0a541fb1 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Tue, 1 Jan 2008 14:34:07 +0000 Subject: [PATCH] Avoid ?: construct without the middle term. --- ChangeLog | 4 ++++ src/useradd.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2cd0a1fe..aeb2e8d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-01 Nicolas François + + * src/useradd.c: Avoid ?: construct without the middle term. + 2008-01-01 Nicolas François * libmisc/copydir.c, src/usermod.c, lib/prototypes.h: The uid and diff --git a/src/useradd.c b/src/useradd.c index e591e1c4..5ae62d6d 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -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); -- 2.50.1