aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/string/strdup.c
blob: e59dff450b2b85fcda3fdb51469381481209ab0b (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;
}