From: Alejandro Colomar Date: Tue, 9 Jan 2024 20:17:13 +0000 (+0100) Subject: src/useradd.c: Simplify, by calling a2sl() instead of str2sl() X-Git-Tag: 4.17.0-rc1~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b178fed180ab96c32dbe197506ebf858b25a8a70;p=thirdparty%2Fshadow.git src/useradd.c: Simplify, by calling a2sl() instead of str2sl() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- diff --git a/src/useradd.c b/src/useradd.c index 9b4852265..d307aecae 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -37,7 +37,7 @@ #include #include "alloc/x/xmalloc.h" -#include "atoi/str2i.h" +#include "atoi/a2i.h" #include "atoi/getnum.h" #include "chkname.h" #include "defines.h" @@ -419,8 +419,7 @@ static void get_defaults (void) * Default Password Inactive value */ else if (MATCH (buf, DINACT)) { - if ( (str2sl(&def_inactive, ccp) == -1) - || (def_inactive < -1)) { + if (a2sl(&def_inactive, ccp, NULL, 0, -1, LONG_MAX) == -1) { fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, ccp); @@ -1288,8 +1287,9 @@ static void process_flags (int argc, char **argv) eflg = true; break; case 'f': - if ( (str2sl(&def_inactive, optarg) == -1) - || (def_inactive < -1)) { + if (a2sl(&def_inactive, optarg, NULL, 0, -1, LONG_MAX) + == -1) + { fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, optarg);