5 intmax_t strtoimax(const char *s1, char **p, int base)
7 const unsigned char *s = s1;
11 /* Initial whitespace */
12 for (; isspace(*s); s++);
15 if (*s == '-') sign = *s++;
16 else if (*s == '+') s++;
18 x = strtoumax(s, p, base);
20 if (!sign || -x != INTMAX_MIN)
22 return sign ? INTMAX_MIN : INTMAX_MAX;