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 <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include <sys/stat.h>
#include <fcntl.h>
-#include "atoi/strtou_noneg.h"
+#include "atoi/str2i.h"
#include "defines.h"
#include "prototypes.h"
#include "subordinateio.h"
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))