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/strlcpy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'userland/libc/string/strlcpy.c') diff --git a/userland/libc/string/strlcpy.c b/userland/libc/string/strlcpy.c index a2d3dd9..041522b 100644 --- a/userland/libc/string/strlcpy.c +++ b/userland/libc/string/strlcpy.c @@ -7,12 +7,14 @@ size_t *strlcpy(char *s1, const char *s2, size_t n) { size_t tmp_n = n; const char *os2 = s2; for (; tmp_n; tmp_n--) { - if ((*s1++ = *s2++) == '\0') + if ((*s1++ = *s2++) == '\0') { break; + } } if (tmp_n == 0) { - if (n != 0) + if (n != 0) { *s1 = '\0'; /* NUL-terminate s1 */ + } while (*s2++) ; } -- cgit v1.2.3