summaryrefslogtreecommitdiff
path: root/userland/libc/string/strtok.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
committerAnton Kling <anton@kling.gg>2024-12-12 16:03:08 +0100
commitb033314bf1901d436dc71d41d5e1f37dda47e511 (patch)
tree120bd137888a7f96904a47af7d20422608ffe225 /userland/libc/string/strtok.c
parentdcbcdbdc5bcfb86eca05fb655e3bf009d89e39e0 (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.c12
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;