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/string/strrchr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'userland/libc/string/strrchr.c') diff --git a/userland/libc/string/strrchr.c b/userland/libc/string/strrchr.c index a44199a..30b625d 100644 --- a/userland/libc/string/strrchr.c +++ b/userland/libc/string/strrchr.c @@ -3,10 +3,12 @@ char *strrchr(const char *s, int c) { char *last = NULL; for (; *s; s++) { - if (*s == (char)c) + if (*s == (char)c) { last = (char *)s; + } + } + if ((char)c == '\0') { + last = (char *)s; } - if ((char)c == '\0') - last = (char*)s; return last; } -- cgit v1.2.3