diff options
author | Anton Kling <anton@kling.gg> | 2023-11-23 00:52:35 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-23 00:52:35 +0100 |
commit | 81819f711e6d1f9216f688da8ecbbc682d106d9c (patch) | |
tree | 0f0df7c43cc5bc956c2c067e55766bfa90823a7f /userland/libc/stdlib/strtol.c | |
parent | ec91e81a4fcfd7ee6bc4150f06d8740e82f808da (diff) |
LibC: Reduce warnings in code
Diffstat (limited to 'userland/libc/stdlib/strtol.c')
-rw-r--r-- | userland/libc/stdlib/strtol.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/userland/libc/stdlib/strtol.c b/userland/libc/stdlib/strtol.c index 7aa7760..09a5ad7 100644 --- a/userland/libc/stdlib/strtol.c +++ b/userland/libc/stdlib/strtol.c @@ -1,7 +1,8 @@ +#include <assert.h> +#include <ctype.h> #include <errno.h> #include <limits.h> #include <stdlib.h> -#include <assert.h> extern int errno; extern int get_value(char c, long base); @@ -10,17 +11,17 @@ extern int get_value(char c, long base); long strtol(const char *str, char **restrict endptr, int base) { long ret_value = 0; if (endptr) - *endptr = str; + *endptr = (char *)str; // Ignore inital white-space sequence for (; *str && isspace(*str); str++) ; if (!*str) return ret_value; - int sign = 0; + // int sign = 0; if ('-' == *str) { // FIXME - sign = 1; + // sign = 1; str++; assert(0); } else if ('+' == *str) { @@ -47,6 +48,6 @@ long strtol(const char *str, char **restrict endptr, int base) { return 0; } if (endptr) - *endptr = str; + *endptr = (char*)str; return ret_value; } |