37 if ((buff = (
char *)
malloc(bytes + 1)) ==
NULL)
43 memcpy(buff, s, bytes + 1);
C size_t strlen(const char *str)
Calculate the length of a string.
C void * memcpy(void *dest, const void *src, size_t count)
Copy memory from one place to another.
C void * malloc(size_t size)
A memory allocator.
char * strndup(const char *s, size_t size)
Duplicate a specific number of bytes from a string.
#define NULL
NULL means zero.