Add a strtoul() wrapper
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user