1 2 3 4 5 6 7 8 9 10 11 12
#include "lib9.h" char* strdup(const char *s) { char *os; os = malloc(strlen(s) + 1); if(os == 0) return 0; return strcpy(os, s); }