2013-05-29 20:41:58 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2018-06-17 13:42:26 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2013-05-29 20:41:58 +00:00
|
|
|
|
2018-06-21 20:33:47 +00:00
|
|
|
char* strdup(const char* s)
|
2013-05-29 20:41:58 +00:00
|
|
|
{
|
|
|
|
int len = strlen(s);
|
2018-06-21 20:33:47 +00:00
|
|
|
char* p = malloc(len + 1);
|
2013-05-29 20:41:58 +00:00
|
|
|
if (p)
|
2018-06-21 20:33:47 +00:00
|
|
|
memcpy(p, s, len + 1);
|
2013-05-29 20:41:58 +00:00
|
|
|
return p;
|
|
|
|
}
|