blob: 0eb8093177f012bffb982a4aa945c208d7e78566 [file] [log] [blame]
#include "libc.h"
#include <stdlib.h>
#include <string.h>
char* __strdup(const char* s) {
size_t l = strlen(s);
char* d = malloc(l + 1);
if (!d)
return NULL;
return memcpy(d, s, l + 1);
}
weak_alias(__strdup, strdup);