aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/string/strdup.c
blob: 82d14ef4f1b9df8182b04efa3f9390f5fc5a253e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include <kernel/lib/string.h>
#include <kernel/memory/alloc.h>

char *strdup(const char *orig)
{
	size_t s_orig = strlen(orig);
	char *ret = (char *)kmalloc(s_orig + 1);
	strcpy(ret, orig);
	return ret;
}