From: Alejandro Colomar Date: Tue, 14 Dec 2021 11:40:06 +0000 (+0100) Subject: usermod: Remove special case for "" X-Git-Tag: 4.10~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F455%2Fhead;p=thirdparty%2Fshadow.git usermod: Remove special case for "" That special case is already handled by the called function: strtoday() so we can simplify the calling code. Link: Signed-off-by: Alejandro Colomar --- diff --git a/src/usermod.c b/src/usermod.c index 1069be1e1..af3ce9b76 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -1073,18 +1073,14 @@ static void process_flags (int argc, char **argv) } break; case 'e': - if ('\0' != *optarg) { - user_newexpire = strtoday (optarg); - if (user_newexpire < -1) { - fprintf (stderr, - _("%s: invalid date '%s'\n"), - Prog, optarg); - exit (E_BAD_ARG); - } - user_newexpire *= DAY / SCALE; - } else { - user_newexpire = -1; + user_newexpire = strtoday (optarg); + if (user_newexpire < -1) { + fprintf (stderr, + _("%s: invalid date '%s'\n"), + Prog, optarg); + exit (E_BAD_ARG); } + user_newexpire *= DAY / SCALE; eflg = true; break; case 'f':