]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/libopts/compat/strdup.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / libopts / compat / strdup.c
1 /*
2  * Platforms without strdup ?!?!?!
3  */
4
5 static char *
6 strdup( char const *s );
7
8 static char *
9 strdup( char const *s )
10 {
11     char *cp;
12
13     if (s == NULL)
14         return NULL;
15
16     cp = (char *) AGALOC((unsigned) (strlen(s)+1), "strdup");
17
18     if (cp != NULL)
19         (void) strcpy(cp, s);
20
21     return cp;
22 }