initial check-in, version 0.5.0
[musl] / src / stdlib / strtoull.c
1 #include <stdlib.h>
2 #include <inttypes.h>
3 #include <errno.h>
4 #include <limits.h>
5
6 unsigned long long strtoull(const char *s, char **p, int base)
7 {
8         uintmax_t x = strtoumax(s, p, base);
9         if (x > ULLONG_MAX) {
10                 errno = ERANGE;
11                 return ULLONG_MAX;
12         }
13         return x;
14 }