From: Alejandro Colomar Date: Tue, 9 Jan 2024 13:53:59 +0000 (+0100) Subject: src/check_subid_range.c: Call str2ul() instead of strtoul_noneg() X-Git-Tag: 4.15.2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a1e1cf098d0e0a76cc22e50d0c5f37c7190265;p=thirdparty%2Fshadow.git src/check_subid_range.c: Call str2ul() instead of strtoul_noneg() It is a simpler call, with more type safety. A consequence of this change is that the program now accepts numbers in bases 8 and 16. That's not a problem here, I think. Reviewed-by: Iker Pedrosa Signed-off-by: Alejandro Colomar --- diff --git a/src/check_subid_range.c b/src/check_subid_range.c index 5dc0bd7d5..68266f558 100644 --- a/src/check_subid_range.c +++ b/src/check_subid_range.c @@ -13,7 +13,7 @@ #include #include -#include "atoi/strtou_noneg.h" +#include "atoi/str2i.h" #include "defines.h" #include "prototypes.h" #include "subordinateio.h" @@ -36,11 +36,9 @@ int main(int argc, char **argv) owner = argv[1]; check_uids = argv[2][0] == 'u'; errno = 0; - start = strtoul_noneg(argv[3], NULL, 10); - if (errno != 0) + if (str2ul(&start, argv[3]) == -1) exit(1); - count = strtoul_noneg(argv[4], NULL, 10); - if (errno != 0) + if (str2ul(&count, argv[4]) == -1) exit(1); if (check_uids) { if (have_sub_uids(owner, start, count))