]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/pw.c
Create a strtounum function using the same API as strtonum
[pw-darwin.git] / pw / pw.c
diff --git a/pw/pw.c b/pw/pw.c
index c1d9cd32a708527c6c37ea23a46f0f36ab27aae6..88c83dbfa125a5cdda983d620d2a555ab774c6c0 100644 (file)
--- a/pw/pw.c
+++ b/pw/pw.c
@@ -199,7 +199,7 @@ main(int argc, char *argv[])
                        cmdhelp(mode, which);
                else if (which != -1 && mode != -1) {
                        if (strspn(argv[1], "0123456789") == strlen(argv[1])) {
-                               id = strtonum(argv[1], 0, LONG_MAX, &errstr);
+                               id = strtounum(argv[1], 0, UID_MAX, &errstr);
                                if (errstr != NULL)
                                        errx(EX_USAGE, "Bad id '%s': %s",
                                            argv[1], errstr);
@@ -269,7 +269,7 @@ main(int argc, char *argv[])
                        }
                        if (strspn(optarg, "0123456789") != strlen(optarg))
                                errx(EX_USAGE, "-g expects a number");
-                       id = strtonum(optarg, 0, GID_MAX, &errstr);
+                       id = strtounum(optarg, 0, GID_MAX, &errstr);
                        if (errstr != NULL)
                                errx(EX_USAGE, "Bad id '%s': %s", optarg,
                                    errstr);
@@ -281,7 +281,7 @@ main(int argc, char *argv[])
                                addarg(&arglist, 'u', optarg);
                                break;
                        }
-                       id = strtonum(optarg, 0, UID_MAX, &errstr);
+                       id = strtounum(optarg, 0, UID_MAX, &errstr);
                        if (errstr != NULL)
                                errx(EX_USAGE, "Bad id '%s': %s", optarg,
                                    errstr);