7 uintmax_t strtoumax(const char *s1, char **p, int base)
9 const unsigned char *s = (void *)s1;
10 struct intparse ip = {0};
12 if (p) *p = (char *)s1;
14 if (base && base-2U > 34) {
19 for (; isspace(*s); s++);
22 __intparse(&ip, s, SIZE_MAX);
24 if (p && ip.err != EINVAL)
25 *p = (char *)s + ip.cnt;
29 if (ip.err == EINVAL) return 0;
33 return ip.neg ? -ip.val : ip.val;