aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-16 15:59:46 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-16 15:59:46 +0200
commit3d6a857b9186ef6304ea6cf04627c2b787169f29 (patch)
tree756179ce1e1838f75c57e3efec2a570d72051594 /src/lib/libc/stdlib.c
parent59000174aa50ed6b2d24a71576d15e6a53c5be0c (diff)
downloadkogata-3d6a857b9186ef6304ea6cf04627c2b787169f29.tar.gz
kogata-3d6a857b9186ef6304ea6cf04627c2b787169f29.zip
Make way for libc implementation
Diffstat (limited to 'src/lib/libc/stdlib.c')
-rw-r--r--src/lib/libc/stdlib.c6
1 files changed, 3 insertions, 3 deletions
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;
}