summaryrefslogtreecommitdiffstats
path: root/pw/pw.h
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-07-29 06:22:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-07-29 06:22:41 +0000
commit0fd55c6858b1ed5f985845d4fa4c97efef3f363e (patch)
tree8b854016b077aa41001748b8b27254a141a94645 /pw/pw.h
parent665045c10833ba8c2f646fe57f9c423122cd24b8 (diff)
downloadpw-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/pw/pw.h b/pw/pw.h
index ed3b715..3ab3c74 100644
--- a/pw/pw.h
+++ b/pw/pw.h
@@ -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);