EMILE/libunix/strdup.c
Laurent Vivier 9bd9755dbb Update email address
Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
2013-09-05 14:45:27 +02:00

21 lines
294 B
C

/*
*
* (c) 2004,2005 Laurent Vivier <Laurent@Vivier.EU>
*
*/
#include <stdlib.h>
#include <string.h>
char *strdup (__const char *__restrict __src)
{
char *__dest;
__dest = (char*)malloc(strlen(__src) + 1);
if (__dest == NULL)
return NULL;
strcpy(__dest, __src);
return __dest;
}