wraith-lang/src/util.c

16 lines
227 B
C
Raw Normal View History

2021-05-07 00:15:17 +00:00
#include "util.h"
#include <string.h>
char* strdup (const char* s)
{
size_t slen = strlen(s);
char* result = malloc(slen + 1);
if(result == NULL)
{
return NULL;
}
memcpy(result, s, slen+1);
return result;
}