Sign in
googlers
/
maze
/
klibc
/
refs/tags/klibc-0.178
/
.
/
klibc
/
strncat.c
blob: 264ba315a9f23ca12be7e23270d8d9d3e68d2bdc [
file
] [
log
] [
blame
]
/*
* strncat.c
*/
#include
<string.h>
#include
<klibc/compiler.h>
char
*
strncat
(
char
*
dst
,
const
char
*
src
,
size_t
n
)
{
char
*
q
=
strchr
(
dst
,
'\0'
);
size_t
nn
=
q
-
dst
;
if
(
__likely
(
nn
<=
n
)
)
n
=
nn
;
memcpy
(
q
,
src
,
n
);
q
[
n
]
=
'\0'
;
return
dst
;
}