33 #include <sys/cdefs.h> 34 __FBSDID(
"$FreeBSD: src/lib/libc/string/strndup.c,v 1.1 2008/12/06 09:37:54 kib Exp $");
49 for(len = 0; len < n && str[len]; len++)
char * strndup(const char *str, size_t n)
Duplicate n bytes of the passed in string str.
void * malloc(size_t size)
Allocates size bytes of uninitialized storage.
void * memcpy(void *__restrict dest, const void *__restrict src, size_t n)
Copies n characters from the object pointed to by src to the object pointed to by dest.