blob: af61f5a0f3e3fce08258d425e25a23ee4e752f09 [file] [log] [blame] [raw]
#include <string.h>
#include <stdlib.h>
char *strdup(const char *str) {
size_t len = strlen(str) + 1;
char *copy = malloc(len);
if(copy) memcpy(copy, str, len);
return copy;
}