usermod: Remove special case for ""

That special case is already handled by the called function: strtoday()
so we can simplify the calling code.

Link: <https://github.com/shadow-maint/shadow/issues/454>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-12-14 12:40:06 +01:00
parent 9a9c9231db
commit e2f1fcca0e

View File

@ -1073,18 +1073,14 @@ static void process_flags (int argc, char **argv)
} }
break; break;
case 'e': case 'e':
if ('\0' != *optarg) { user_newexpire = strtoday (optarg);
user_newexpire = strtoday (optarg); if (user_newexpire < -1) {
if (user_newexpire < -1) { fprintf (stderr,
fprintf (stderr, _("%s: invalid date '%s'\n"),
_("%s: invalid date '%s'\n"), Prog, optarg);
Prog, optarg); exit (E_BAD_ARG);
exit (E_BAD_ARG);
}
user_newexpire *= DAY / SCALE;
} else {
user_newexpire = -1;
} }
user_newexpire *= DAY / SCALE;
eflg = true; eflg = true;
break; break;
case 'f': case 'f':