iconv: fix missing bounds checking for shift_jis decoding
[musl.git] / src / string / strlcat.c
blobef81209e35efeb2ae18e50b4fd99d85ae2aaf924
1 #define _BSD_SOURCE
2 #include <string.h>
4 size_t strlcat(char *d, const char *s, size_t n)
6 size_t l = strnlen(d, n);
7 if (l == n) return l + strlen(s);
8 return l + strlcpy(d+l, s, n-l);