projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
9ab66fd9e4d55ae3b052ae2fdd1b54938f3d1329
[musl]
/
src
/
stdlib
/
strtoll.c
1
#include <stdlib.h>
2
#include <inttypes.h>
3
#include <errno.h>
4
#include <limits.h>
5
6
long long strtoll(const char *s, char **p, int base)
7
{
8
intmax_t x = strtoimax(s, p, base);
9
if (x > LLONG_MAX) {
10
errno = ERANGE;
11
return LLONG_MAX;
12
} else if (x < LLONG_MIN) {
13
errno = ERANGE;
14
return LLONG_MIN;
15
}
16
return x;
17
}