Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / libntp / strdup.c
blob8ae17bc5569f5676f355c8d87f4feed655caa437
1 /* $NetBSD$ */
3 #include "ntp_malloc.h"
5 #if !HAVE_STRDUP
7 #define NULL 0
9 char *strdup(const char *s);
11 char *
12 strdup(
13 const char *s
16 char *cp;
18 if (s) {
19 cp = (char *) malloc((unsigned) (strlen(s)+1));
20 if (cp) {
21 (void) strcpy(cp, s);
23 } else {
24 cp = (char *) NULL;
26 return(cp);
28 #else
29 int strdup_bs;
30 #endif