source: bootcd/isolinux/syslinux-6.03/com32/lib/strdup.c

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 190 bytes
Line 
1/*
2 * strdup.c
3 */
4
5#include <string.h>
6#include <stdlib.h>
7
8char *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.