lib/limits.c: setup_limits(): Simplify, by calling str2si() 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:33 +01:00
parent 312c3b1389
commit 3fd1d62e29

View File

@@ -496,9 +496,9 @@ void setup_limits (const struct passwd *info)
continue;
}
if (strncmp (cp, "ulimit=", 7) == 0) {
long blocks;
if ( (str2sl(&blocks, cp + 7) == -1)
|| (blocks != (int) blocks)
int blocks;
if ( (str2si(&blocks, cp + 7) == -1)
|| (set_filesize_limit (blocks) != 0)) {
SYSLOG ((LOG_WARN,
"Can't set the ulimit for user %s",