strncat is insufficient

Colin Plumb colin at array.UUCP
Sat Aug 25 07:12:56 AEST 1990


char *strlimcat(char *dst, char const *src, int maxlen)
{
	int len;

	len = strlen(dst);
	if (len < maxlen)
		strncpy(dst+len, src, maxlen-len);
	return dst;
}



More information about the Comp.std.c mailing list