13 while (
isspace((
unsigned char)*p))
19 if (*p !=
'+' && *p !=
'-')
33 if ((*base == 0 || *base == 16) && (*p ==
'x' || *p ==
'X'))
67 return ((*base >= 2) && (*base <= 36)) ? p :
NULL;
81 if ((rc < limval) || ((rc == limval) && (digit <= limdigit)))
83 rc = rc * base + (unsigned)digit;
112unsigned long int strtoul(
const char* s,
char** endptr,
int base)
114 unsigned long int rc;
118 if (base < 2 || base > 36)
128 *endptr = (p !=
NULL) ? (
char*)p : (
char*)s;
131 return (sign ==
'+') ? rc : -rc;
#define ERANGE
Math result not representable.
#define errno
Error number variable.
#define NULL
Pointer error value.
__UINTMAX_TYPE__ uintmax_t
_PUBLIC void * memchr(const void *s, int c, size_t n)
static const char * _strtox_prelim(const char *p, char *sign, int *base)
unsigned long int strtoul(const char *s, char **endptr, int base)
static uintmax_t _strtox_main(const char **p, unsigned int base, uintmax_t error, uintmax_t limval, int limdigit, char *sign)