Fixed my ChangeLog e-mail address.
[mdsms.git] / strdup.c
1 #include "config.h"
2 #ifndef lint
3 static char rcsid[] ATTR_UNUSED = "$Id$";
4 #endif
5
6 /* This part of code is a public domain */
7
8 #include <string.h>
9 #include <stdlib.h>
10
11 /* CONFORMING TO SVID 3, BSD 4.3 */
12
13 char *strdup(const char *s)
14 {
15 size_t l;
16 char *d;
17
18         if (!(d=malloc(l=strlen(s)+1))) return(NULL);
19         return memcpy(d,s,l);
20 }