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