From 03ec980f269c8222eaeeb3bbae8c3cab20595bfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 13 Jul 2014 05:56:30 +0200
Subject: Add a strtoul() wrapper
---
src/common.c | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'src/common.c')
diff --git a/src/common.c b/src/common.c
index fcb9742..8ec6646 100644
--- a/src/common.c
+++ b/src/common.c
@@ -1417,6 +1417,15 @@ set_boolean_if_valid (bool *out, const char *s)
return true;
}
+static bool
+xstrtoul (unsigned long *out, const char *s, int base)
+{
+ char *end;
+ errno = 0;
+ *out = strtoul (s, &end, base);
+ return errno == 0 && !*end && end != s;
+}
+
static bool
read_line (FILE *fp, struct str *s)
{
--
cgit v1.2.3