From b033314bf1901d436dc71d41d5e1f37dda47e511 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 12 Dec 2024 16:03:08 +0100 Subject: formatting: Use clang-format on all projects This commit also add braces to all `if` statements. --- userland/libc/stdlib/strtoul.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'userland/libc/stdlib/strtoul.c') diff --git a/userland/libc/stdlib/strtoul.c b/userland/libc/stdlib/strtoul.c index 39dc8eb..0f2c71b 100644 --- a/userland/libc/stdlib/strtoul.c +++ b/userland/libc/stdlib/strtoul.c @@ -25,13 +25,15 @@ int get_value(char c, long base) { unsigned long strtoul(const char *restrict str, char **restrict endptr, int base) { unsigned long ret_value = 0; - if (endptr) + if (endptr) { *endptr = (char *)str; + } // Ignore inital white-space sequence for (; *str && isspace(*str); str++) ; - if (!*str) + if (!*str) { return ret_value; + } // int sign = 0; if ('-' == *str) { @@ -79,7 +81,8 @@ unsigned long strtoul(const char *restrict str, char **restrict endptr, errno = EINVAL; return 0; } - if (endptr) + if (endptr) { *endptr = (char *)str; + } return ret_value; } -- cgit v1.2.3