Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
d41cdef9198e635270d30e82be939d4ea0cbce82
/
.
/
src
/
string
/
strlcat.c
blob: ef81209e35efeb2ae18e50b4fd99d85ae2aaf924 [
file
] [
log
] [
blame
]
#define
_BSD_SOURCE
#include
<string.h>
size_t
strlcat
(
char
*
d
,
const
char
*
s
,
size_t
n
)
{
size_t
l
=
strnlen
(
d
,
n
);
if
(
l
==
n
)
return
l
+
strlen
(
s
);
return
l
+
strlcpy
(
d
+
l
,
s
,
n
-
l
);
}