repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
iconv: fix missing bounds checking for shift_jis decoding
[musl.git]
/
src
/
string
/
strlcat.c
blob
ef81209e35efeb2ae18e50b4fd99d85ae2aaf924
1
#define _BSD_SOURCE
2
#include <string.h>
3
4
size_t
strlcat
(
char
*
d
,
const char
*
s
,
size_t
n
)
5
{
6
size_t
l
=
strnlen
(
d
,
n
);
7
if
(
l
==
n
)
return
l
+
strlen
(
s
);
8
return
l
+
strlcpy
(
d
+
l
,
s
,
n
-
l
);
9
}