/* * Replacement for strdup() function */ char *strdup(const char *s) { char *n = (char *)malloc(strlen(s) + 1); strcpy(n, s); return n; }