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/strtok.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/strtok.c')
-rw-r--r-- | userland/libc/string/strtok.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/userland/libc/string/strtok.c b/userland/libc/string/strtok.c index 7b8d0e3..a4a9d0f 100644 --- a/userland/libc/string/strtok.c +++ b/userland/libc/string/strtok.c @@ -7,18 +7,20 @@ char *strtok(char *restrict s, const char *restrict sep) { strtok_s = s; return strtok(NULL, sep); } - if(!strtok_s) - return NULL; + if (!strtok_s) { + return NULL; + } char *e = strpbrk(strtok_s, sep); if (!e) { - char *r = strtok_s; - strtok_s = NULL; + char *r = strtok_s; + strtok_s = NULL; return r; } *e = '\0'; e--; - for (; *sep; sep++) + for (; *sep; sep++) { e++; + } e++; char *r = strtok_s; strtok_s = e; |