diff options
author | Marvin Borner | 2020-03-18 17:32:50 +0100 |
---|---|---|
committer | Marvin Borner | 2020-03-18 17:32:50 +0100 |
commit | f495cc1e93710c233292a503720ec235a61b685c (patch) | |
tree | 23b0b4b82b6d80001c1ffdb15f00b93cbdc65722 /src/kernel/lib/stdlib/atoi.c | |
parent | c6657aac0c5d5ecf347bc082cb6df38e1174d297 (diff) |
Applied official linux kernel code style guidelines
Due to my change to vim and the clang-format plugin this was needed!
Diffstat (limited to 'src/kernel/lib/stdlib/atoi.c')
-rw-r--r-- | src/kernel/lib/stdlib/atoi.c | 28 |
1 files changed, 16 insertions, 12 deletions
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 |