]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/getdef.c: getdef_long(): Simplify, by calling a2sl() instead of str2sl()
authorAlejandro Colomar <alx@kernel.org>
Tue, 9 Jan 2024 19:01:09 +0000 (20:01 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 2 Jul 2024 20:52:31 +0000 (22:52 +0200)
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/getdef.c

index 5475b40e0d08fddb83a3ff045ff472f9fd770fa2..cc635ae73f7ae164c7e3cb2e331eb6aa3a2aed0d 100644 (file)
@@ -316,7 +316,7 @@ long getdef_long (const char *item, long dflt)
                return dflt;
        }
 
-       if (str2sl(&val, d->value) == -1 || val < -1) {
+       if (a2sl(&val, d->value, NULL, 0, -1, LONG_MAX) == -1) {
                fprintf (shadow_logfd,
                         _("configuration error - cannot parse %s value: '%s'"),
                         item, d->value);