aboutsummaryrefslogtreecommitdiff
path: root/stecpy.c
blob: 2fec72da5e847de9acaa18569f7341c817182eb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
char *
stecpy(char *dst, char *end, const char *src)
{
	if (dst >= end)
		return dst;

	while (dst < end && (*dst = *src))
		src++, dst++;

	if (dst == end)
		dst[-1] = 0;

	return dst;
}