Fix strtol
This commit is contained in:
@@ -17,9 +17,12 @@
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/strlol.internal.h"
|
||||
#include "libc/limits.h"
|
||||
|
||||
long long strtoll(const char *s, char **endptr, int optional_base) {
|
||||
return STRLOL(s, endptr, optional_base, LONG_LONG_MIN, LONG_LONG_MAX);
|
||||
long long res;
|
||||
res = strtoimax(s, endptr, optional_base);
|
||||
if (res < LONG_LONG_MIN) return LONG_LONG_MIN;
|
||||
if (res > LONG_LONG_MAX) return LONG_LONG_MAX;
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user