source:
bootcd/isolinux/syslinux-6.03/com32/lib/strdup.c
@
7b6b7ba
Last change on this file since 7b6b7ba was e16e8f2, checked in by , 3 years ago | |
---|---|
|
|
File size: 190 bytes |
Rev | Line | |
---|---|---|
[e16e8f2] | 1 | /* |
2 | * strdup.c | |
3 | */ | |
4 | ||
5 | #include <string.h> | |
6 | #include <stdlib.h> | |
7 | ||
8 | char *strdup(const char *s) | |
9 | { | |
10 | int l = strlen(s) + 1; | |
11 | char *d = malloc(l); | |
12 | ||
13 | if (d) | |
14 | memcpy(d, s, l); | |
15 | ||
16 | return d; | |
17 | } |
Note: See TracBrowser
for help on using the repository browser.