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;
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':