summaryrefslogtreecommitdiff
path: root/kernel/libc/string/strlcpy.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-02-21 00:14:29 +0100
committerAnton Kling <anton@kling.gg>2024-02-21 00:14:29 +0100
commit8ff63b062d724826d8017504063df9b92f8e6703 (patch)
tree03bf0b5a278a4908da8912f956e5651bea9412f1 /kernel/libc/string/strlcpy.c
parenta85eacdd2406fede4d6ff5cb130b1758978cabb3 (diff)
New clang-format options
Diffstat (limited to 'kernel/libc/string/strlcpy.c')
-rw-r--r--kernel/libc/string/strlcpy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/libc/string/strlcpy.c b/kernel/libc/string/strlcpy.c
index 43d0e58..1338699 100644
--- a/kernel/libc/string/strlcpy.c
+++ b/kernel/libc/string/strlcpy.c
@@ -8,12 +8,14 @@ size_t strlcpy(char *dst, const char *src, size_t dsize) {
size_t n = dsize;
const char *osrc = src;
for (; n; n--) {
- if ((*dst++ = *src++) == '\0')
+ if ((*dst++ = *src++) == '\0') {
break;
+ }
}
if (n == 0) {
- if (dsize != 0)
+ if (dsize != 0) {
*dst = '\0'; /* NUL-terminate dst */
+ }
while (*src++)
;
}