forked from KolibriOS/kolibrios
12 lines
211 B
C
12 lines
211 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
char* strdup(const char* str)
|
|
{
|
|
char* buf = malloc(strlen(str) + 1);
|
|
if (buf) {
|
|
buf[strlen(str)] = '\0';
|
|
strcpy(buf, str);
|
|
}
|
|
return buf;
|
|
} |