summaryrefslogtreecommitdiff
path: root/src/string/strlcat.c
blob: a6b94c4c3febac7ac7104035e3aed04e6d4e9b4d (plain) (blame)
1
2
3
4
5
6
7
8
#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);
}