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/strtok.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'userland/libc/string/strtok.c') 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; -- cgit v1.2.3