Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/klibc/strdup.c

Source at commit 1292 created 12 years 8 months ago.
By meklort, Add additional functions to klibc. Remove duplicates from libsa
1/*
2 * strdup.c
3 */
4
5#include <string.h>
6#include <stdlib.h>
7
8char *strdup(const char *s)
9{
10int l = strlen(s) + 1;
11char *d = malloc(l);
12
13if (d)
14memcpy(d, s, l);
15
16return d;
17}
18

Archive Download this file

Revision: 1292