From: Alejandro Colomar Date: Tue, 9 Jan 2024 19:03:16 +0000 (+0100) Subject: lib/limits.c: setup_limits(): Simplify, by calling a2si() instead of str2sl() X-Git-Tag: 4.17.0-rc1~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=312c3b138902dfd3ff53f62a2d42a6ef4c4bae3f;p=thirdparty%2Fshadow.git lib/limits.c: setup_limits(): Simplify, by calling a2si() instead of str2sl() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- diff --git a/lib/limits.c b/lib/limits.c index e86ac238a..636d087d3 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -478,10 +478,9 @@ void setup_limits (const struct passwd *info) } if (strncmp (cp, "pri=", 4) == 0) { - long inc; + int inc; - if ( (str2sl(&inc, cp + 4) == 0) - && (inc >= -20) && (inc <= 20)) { + if (a2si(&inc, cp + 4, NULL, 0, -20, 20) == 0) { errno = 0; if ( (nice (inc) != -1) || (0 != errno)) {