Beispiel #1
0
/**
 * strncat - Append a length-limited, %NUL-terminated string to another
 * @dest: The string to be appended to
 * @src: The string to append to it
 * @count: The maximum numbers of bytes to copy
 *
 * Note that in contrast to strncpy, strncat ensures the result is
 * terminated.
 */
char * strncat(char *dest, const char *src, size_t count)
{
#ifndef __HAVE_ARCH_STRNCAT
	char *tmp = dest;

	if (count) {
		while (*dest)
			dest++;
		while ((*dest++ = *src++) != 0) {
			if (--count == 0) {
				*dest = '\0';
				break;
			}
		}
	}

	return tmp;
#else
	return __strncat(dest, src, count);
#endif
}
Beispiel #2
0
char *
__old_strncat_g (char *dest, const char *src, size_t n)
{
  return __strncat (dest, src, n);
}