/* Note that in contrast to strncpy(), strncat() ensures the result is terminated.  */
char* strncat(char *dest, const char *src, size_t count)
/* Note that in contrast to strncpy(), strncat() ensures the result is terminated.  */
char* strncat(char *dest, const char *src, size_t count)
{
	char *tmp = dest;
	if (count) {
		while (*dest)
			dest++;
		while ((*dest++ = *src++) != 0) {
			if (--count == 0) {
				*dest = '\0';
				break;
			}
		}
	}
	return tmp;
}