From: Alejandro Colomar Date: Tue, 9 Jan 2024 19:02:38 +0000 (+0100) Subject: lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) instead of str2ul() X-Git-Tag: 4.17.0-rc1~163 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=169cbe1f56a6782d5cd1667b37fb84ee3313fe42;p=thirdparty%2Fshadow.git lib/limits.c: set_umask(): Simplify, by calling str2i(mode_t, ) instead of str2ul() Reviewed-by: "Serge E. Hallyn" Signed-off-by: Alejandro Colomar --- diff --git a/lib/limits.c b/lib/limits.c index e75693de9..e86ac238a 100644 --- a/lib/limits.c +++ b/lib/limits.c @@ -99,14 +99,13 @@ set_prio(const char *value) } -static int set_umask (const char *value) +static int +set_umask(const char *value) { - unsigned long mask; + mode_t mask; - if ( (str2ul(&mask, value) == -1) - || (mask != (mode_t) mask)) { + if (str2i(mode_t, &mask, value) == -1) return 0; - } (void) umask (mask); return 0;