blob: e2f2b9be2bde868532d6bd1e2328723e37f4cb44 [file] [log] [blame]
#include <stdlib.h>
#include <string.h>
#undef strdup
#undef __strdup
char* strdup(const char *s)
{
size_t len = strlen (s) + 1;
void *new = malloc (len);
if (new == NULL)
return NULL;
return (char *) memcpy (new, s, len);
}
char* __strdup(const char *s)
{
size_t len = strlen (s) + 1;
void *new = malloc (len);
if (new == NULL)
return NULL;
return (char *) memcpy (new, s, len);
}