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/strndup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'userland/libc/string/strndup.c') diff --git a/userland/libc/string/strndup.c b/userland/libc/string/strndup.c index 22d6303..3240d97 100644 --- a/userland/libc/string/strndup.c +++ b/userland/libc/string/strndup.c @@ -1,7 +1,7 @@ +#include #include #include #include -#include // The strndup() function shall be equivalent to the strdup() function, // duplicating the provided s in a new block of memory allocated as if @@ -16,8 +16,9 @@ char *strndup(const char *s, size_t size) { size_t l = strlen(s); size_t real_l = min(l, size); char *r = malloc(real_l + 1); - if (!r) + if (!r) { return NULL; + } strlcpy(r, s, real_l); return r; } -- cgit v1.2.3