summaryrefslogtreecommitdiff
path: root/com32/lib/lstrdup.c
blob: d11efe7e4c66da13378f5db63c44df64878c983e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * lstrdup.c
 */

#include <string.h>
#include <stdlib.h>
#include <com32.h>

char *lstrdup(const char *s)
{
    int l = strlen(s) + 1;
    char *d = lmalloc(l);

    if (d)
	memcpy(d, s, l);

    return d;
}