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/strstr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'userland/libc/string/strstr.c') diff --git a/userland/libc/string/strstr.c b/userland/libc/string/strstr.c index 9de0954..4300f24 100644 --- a/userland/libc/string/strstr.c +++ b/userland/libc/string/strstr.c @@ -2,8 +2,9 @@ char *strstr(const char *s1, const char *s2) { // If s2 points to a string with zero length, the function shall return s1. - if ('\0' == *s2) - return (char*)s1; + if ('\0' == *s2) { + return (char *)s1; + } for (; *s1; s1++) { const char *t1 = s1; const char *t2 = s2; @@ -14,8 +15,9 @@ char *strstr(const char *s1, const char *s2) { break; } } - if (!is_dif) - return (char*)s1; + if (!is_dif) { + return (char *)s1; + } } return NULL; } -- cgit v1.2.3