#include "nortlib.h" char *nrtl_strdup(const char *s); char *nl_strdup(const char *s);
nrtl_strdup() and nl_strdup() both provide the functionality of the semi-standard strdup() function with the exception that if memory allocation fails, it will cause a fatal error. As such, both functions are guaranteed to return a newly-allocated copy of the passed string.
nrtl_strdup() is the function that is included in the nortlib library. nl_strdup() is implemented as a macro in nortlib.h only if memlib.h has not been included, since the name conflicts with a routine in that library.
Returns a newly allocated copy of the argument string. If memory allocation fails, the program will terminate via nl_error(3).