summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/strtox.c
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-22 23:27:56 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-22 23:30:32 +0100
commit0f30d227497418c6d3bef7d52244407e30454504 (patch)
tree0e1ac19623d3268380cf74328cdf643648a2f43c /lib/libc/stdlib/strtox.c
parent90dad97fc07f049383903a166631e2c257f9b8c1 (diff)
Added c11 threads, fixed some locks and add *_unlocked functions
Diffstat (limited to 'lib/libc/stdlib/strtox.c')
-rw-r--r--lib/libc/stdlib/strtox.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/stdlib/strtox.c b/lib/libc/stdlib/strtox.c
index b50a77a1..276b8c2e 100644
--- a/lib/libc/stdlib/strtox.c
+++ b/lib/libc/stdlib/strtox.c
@@ -6,8 +6,7 @@
#include <stdlib.h> // for strtof, strtol, strtold, strtoll, strtoul, strt...
#include <strings.h> // for strncasecmp
-static unsigned long long
-__scanint(const char *s, int base, unsigned long long lim, int *neg, char **end)
+static unsigned long long __scanint(const char *s, int base, unsigned long long lim, int *neg, char **end)
{
unsigned long long res = 0;
int digit, any = 0;
@@ -21,8 +20,7 @@ __scanint(const char *s, int base, unsigned long long lim, int *neg, char **end)
s++;
}
- if ((base == 0 || base == 16) && s[0] == '0' &&
- (s[1] == 'x' || s[1] == 'X')) {
+ if ((base == 0 || base == 16) && s[0] == '0' && (s[1] == 'x' || s[1] == 'X')) {
base = 16;
s += 2;
} else if (base == 0 && *s == '0') {
@@ -193,8 +191,7 @@ long long strtoll(const char *restrict nptr, char **restrict endptr, int base)
return (long long)v;
}
-unsigned long strtoul(const char *restrict nptr, char **restrict endptr,
- int base)
+unsigned long strtoul(const char *restrict nptr, char **restrict endptr, int base)
{
int neg;
unsigned long long v;
@@ -214,8 +211,7 @@ unsigned long strtoul(const char *restrict nptr, char **restrict endptr,
return (unsigned long)v;
}
-unsigned long long strtoull(const char *restrict nptr, char **restrict endptr,
- int base)
+unsigned long long strtoull(const char *restrict nptr, char **restrict endptr, int base)
{
int neg;
unsigned long long v;