|strdup(3)||Library Functions Manual||strdup(3)|
char *strdup(const char *str);
#define _POSIX_C_SOURCE >= 200809L
char *strndup(const char *str, size_t len);
strndup() allocates a buffer large enough to contain len characters, plus a trailing null character, or sufficient to contain the entirety of str including the trailing null character, whichever is smaller. The first len characters of str are then copied into it, and a null character appended.
The buffers returned by these functions must be released by a call to free().
|February 20, 2013||Fusion|