diff options
author | Marvin Borner | 2020-06-17 18:31:46 +0200 |
---|---|---|
committer | Marvin Borner | 2020-06-17 18:31:46 +0200 |
commit | eed77bd2970a00d1394ed027ceca5b646e4671ce (patch) | |
tree | c44643d98aed2b6818f2b33417c0dea9c5853094 /src/kernel/lib/stdlib/htoa.c | |
parent | 49dfa1f4021026bf7c4d77817959c8aa24067016 (diff) |
Started rewrite
Diffstat (limited to 'src/kernel/lib/stdlib/htoa.c')
-rw-r--r-- | src/kernel/lib/stdlib/htoa.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/kernel/lib/stdlib/htoa.c b/src/kernel/lib/stdlib/htoa.c deleted file mode 100644 index 9cf57cc..0000000 --- a/src/kernel/lib/stdlib/htoa.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <lib/string.h> -#include <memory/alloc.h> -#include <stdint.h> - -static const char HTOA_TABLE[] = "0123456789ABCDEF"; - -char *htoa(u32 n) -{ - char *ret = (char *)malloc(10); - - int i = 0; - while (n) { - ret[i++] = HTOA_TABLE[n & 0xF]; - n >>= 4; - } - - if (!i) { - ret[0] = '0'; - i++; - } - - for (; i <= 9; i++) - ret[i] = 0; - - char *aux = strdup(ret); - free(ret); - ret = aux; - - strinv(ret); - return ret; -}
\ No newline at end of file |