aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/playerdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r--FICS/playerdb.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 5f8dfd6..bdad800 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -61,6 +61,7 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
+#include <limits.h>
#include <stdint.h>
#include "command.h"
@@ -80,6 +81,7 @@
#include "utils.h"
#if __linux__
+#include <bsd/stdlib.h>
#include <bsd/string.h>
#endif
@@ -714,6 +716,16 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version)
}
}
+PUBLIC unsigned int
+get_uint(const char *nptr)
+{
+ const char *errstr = NULL;
+ const unsigned int val = (unsigned int) strtonum(nptr,
+ 0, UINT_MAX, &errstr);
+
+ return (errstr ? 0 : val);
+}
+
PRIVATE int
got_attr_value_player(int p, char *attr, char *value, FILE *fp, char *file)
{