From f495cc1e93710c233292a503720ec235a61b685c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 18 Mar 2020 17:32:50 +0100 Subject: Applied official linux kernel code style guidelines Due to my change to vim and the clang-format plugin this was needed! --- src/kernel/lib/stdlib/atoi.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/kernel/lib/stdlib/atoi.c') diff --git a/src/kernel/lib/stdlib/atoi.c b/src/kernel/lib/stdlib/atoi.c index bcdd395..2d58d84 100644 --- a/src/kernel/lib/stdlib/atoi.c +++ b/src/kernel/lib/stdlib/atoi.c @@ -5,20 +5,24 @@ int atoi(char *str) { - size_t s_str = strlen(str); - if (!s_str) return 0; + size_t s_str = strlen(str); + if (!s_str) + return 0; - uint8_t negative = 0; - if (str[0] == '-') negative = 1; + uint8_t negative = 0; + if (str[0] == '-') + negative = 1; - size_t i = 0; - if (negative) i++; + size_t i = 0; + if (negative) + i++; - int ret = 0; - for (; i < s_str; i++) { - ret += (str[i] - '0') * pow(10, (int) ((s_str - i) - 1)); - } + 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; + if (negative) + ret *= -1; + return ret; } \ No newline at end of file -- cgit v1.2.3