diff options
author | Anton Kling <anton@kling.gg> | 2024-12-12 16:03:08 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-12-12 16:03:08 +0100 |
commit | b033314bf1901d436dc71d41d5e1f37dda47e511 (patch) | |
tree | 120bd137888a7f96904a47af7d20422608ffe225 /userland/libc/string/strstr.c | |
parent | dcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (diff) |
formatting: Use clang-format on all projects
This commit also add braces to all `if` statements.
Diffstat (limited to 'userland/libc/string/strstr.c')
-rw-r--r-- | userland/libc/string/strstr.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; } |