From eed77bd2970a00d1394ed027ceca5b646e4671ce Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 17 Jun 2020 18:31:46 +0200 Subject: Started rewrite --- src/kernel/lib/stdlib/atoi.c | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/kernel/lib/stdlib/atoi.c (limited to 'src/kernel/lib/stdlib/atoi.c') diff --git a/src/kernel/lib/stdlib/atoi.c b/src/kernel/lib/stdlib/atoi.c deleted file mode 100644 index b90958a..0000000 --- a/src/kernel/lib/stdlib/atoi.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include -#include -#include - -int atoi(char *str) -{ - u32 s_str = strlen(str); - if (!s_str) - return 0; - - u8 negative = 0; - if (str[0] == '-') - negative = 1; - - u32 i = 0; - if (negative) - i++; - - int ret = 0; - for (; i < s_str; i++) { - ret += (str[i] - '0') * pow(10, (int)((s_str - i) - 1)); - } - - if (negative) - ret *= -1; - return ret; -} \ No newline at end of file -- cgit v1.2.3