projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix missing SIG_DFL, SIG_IGN, SIG_ERR without posix in signal.h
[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
intmax_t x;
9
if (sizeof(intmax_t) == sizeof(long long))
10
return strtoumax(s, p, base);
11
x = strtoimax(s, p, base);
12
if (-x > ULLONG_MAX || x > ULLONG_MAX) {
13
errno = ERANGE;
14
return ULLONG_MAX;
15
}
16
return x;
17
}