From 81819f711e6d1f9216f688da8ecbbc682d106d9c Mon Sep 17 00:00:00 2001 From: Anton Kling <anton@kling.gg> Date: Thu, 23 Nov 2023 00:52:35 +0100 Subject: LibC: Reduce warnings in code --- userland/libc/stdlib/strtoul.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'userland/libc/stdlib/strtoul.c') diff --git a/userland/libc/stdlib/strtoul.c b/userland/libc/stdlib/strtoul.c index 4d9a51d..c490aeb 100644 --- a/userland/libc/stdlib/strtoul.c +++ b/userland/libc/stdlib/strtoul.c @@ -1,7 +1,8 @@ #include <assert.h> +#include <ctype.h> #include <errno.h> -#include <stdlib.h> #include <limits.h> +#include <stdlib.h> extern int errno; int get_value(char c, long base) { @@ -24,17 +25,17 @@ unsigned long strtoul(const char *restrict str, char **restrict endptr, int base) { unsigned 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) { @@ -67,6 +68,6 @@ unsigned long strtoul(const char *restrict str, char **restrict endptr, return 0; } if (endptr) - *endptr = str; + *endptr = (char*)str; return ret_value; } -- cgit v1.2.3