lib/limits.c: setup_limits(): Simplify, by calling a2si() instead of str2sl()

Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-01-09 20:03:16 +01:00
parent 169cbe1f56
commit 312c3b1389

View File

@@ -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)) {