diff options
author | 2015-07-29 06:22:41 +0000 | |
---|---|---|
committer | 2015-07-29 06:22:41 +0000 | |
commit | 0fd55c6858b1ed5f985845d4fa4c97efef3f363e (patch) | |
tree | 8b854016b077aa41001748b8b27254a141a94645 /pw/pw.h | |
parent | 665045c10833ba8c2f646fe57f9c423122cd24b8 (diff) | |
download | pw-darwin-0fd55c6858b1ed5f985845d4fa4c97efef3f363e.tar.gz pw-darwin-0fd55c6858b1ed5f985845d4fa4c97efef3f363e.tar.zst pw-darwin-0fd55c6858b1ed5f985845d4fa4c97efef3f363e.zip |
Create a strtounum function using the same API as strtonum
This function returns uintmax_t
Use this function to convert to gid_t/uid_t
Diffstat (limited to 'pw/pw.h')
-rw-r--r-- | pw/pw.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -32,6 +32,7 @@ #include <string.h> #include <unistd.h> #include <stdarg.h> +#include <inttypes.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -101,3 +102,6 @@ char *pw_pwcrypt(char *password); extern const char *Modes[]; extern const char *Which[]; + +uintmax_t strtounum(const char *numstr, uintmax_t minval, uintmax_t maxval, + const char **errmsg); |