From 3d6a857b9186ef6304ea6cf04627c2b787169f29 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 16 Jul 2016 15:59:46 +0200 Subject: Make way for libc implementation --- src/lib/libc/stdlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libc/stdlib.c') diff --git a/src/lib/libc/stdlib.c b/src/lib/libc/stdlib.c index d8598dd..540d53c 100644 --- a/src/lib/libc/stdlib.c +++ b/src/lib/libc/stdlib.c @@ -15,10 +15,10 @@ void abort() { PANIC("Aborted."); } -float strtof(const char *nptr, const char **endptr) { +float strtof(const char *nptr, char **endptr) { return (float)strtod(nptr, endptr); } -double strtod(const char *nptr, const char **endptr) { +double strtod(const char *nptr, char **endptr) { // TODO: better (inf, nan, ...) const char* p = nptr; @@ -57,7 +57,7 @@ double strtod(const char *nptr, const char **endptr) { for (int i = 0; i < exp; i++) val /= 10; } } - if (endptr != NULL) *endptr = p-1; + if (endptr != NULL) *endptr = (char*)(p-1); return val * sign; } -- cgit v1.2.3