From a9c7529dcca845d98192ece62be70f752972216b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 13 May 2020 21:28:56 +0200 Subject: Replaced alloc.h with liballoc And many more adaptions to the lib --- src/kernel/lib/stdlib/itoa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/kernel/lib/stdlib/itoa.c') diff --git a/src/kernel/lib/stdlib/itoa.c b/src/kernel/lib/stdlib/itoa.c index b4a9db1..2020ca6 100644 --- a/src/kernel/lib/stdlib/itoa.c +++ b/src/kernel/lib/stdlib/itoa.c @@ -9,7 +9,7 @@ static const char ITOA_TABLE[] = "0123456789"; char *itoa(int n) { if (!n) { - char *ret = (char *)kmalloc(2); + char *ret = (char *)malloc(2); ret[0] = '0'; ret[1] = 0; return ret; @@ -22,7 +22,7 @@ char *itoa(int n) for (sz = 0; n % pow(10, sz) != n; sz++) { } - char *ret = (char *)kmalloc((u32)(sz + 1)); + char *ret = (char *)malloc((u32)(sz + 1)); for (int i = 0; i < sz; i++) { int digit = (n % pow(10, i + 1)) / pow(10, i); @@ -31,11 +31,11 @@ char *itoa(int n) ret[sz] = 0; if (negative) { - char *aux = (char *)kmalloc((u32)(sz + 2)); + char *aux = (char *)malloc((u32)(sz + 2)); strcpy(aux, ret); aux[sz] = '-'; aux[sz + 1] = 0; - kfree(ret); + free(ret); ret = aux; } -- cgit v1.2.3