2021-04-27 18:33:31 +02:00
|
|
|
#include <stdlib.h>
|
2022-04-15 11:00:55 +02:00
|
|
|
#include <string.h>
|
2021-04-27 18:33:31 +02:00
|
|
|
|
2022-04-15 11:00:55 +02:00
|
|
|
char* strdup(const char* str)
|
2021-04-27 18:33:31 +02:00
|
|
|
{
|
2022-04-15 11:00:55 +02:00
|
|
|
char* buf = malloc(strlen(str) + 1);
|
2021-04-27 18:33:31 +02:00
|
|
|
buf[strlen(str)] = '\0';
|
|
|
|
strcpy(buf, str);
|
|
|
|
return buf;
|
|
|
|
}
|