repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Sync usage with man page.
[netbsd-mini2440.git]
/
dist
/
ntp
/
libntp
/
strdup.c
blob
8ae17bc5569f5676f355c8d87f4feed655caa437
1
/* $NetBSD$ */
2
3
#include
"ntp_malloc.h"
4
5
#if !HAVE_STRDUP
6
7
#define NULL 0
8
9
char
*
strdup
(
const char
*
s
);
10
11
char
*
12
strdup
(
13
const char
*
s
14
)
15
{
16
char
*
cp
;
17
18
if
(
s
) {
19
cp
= (
char
*)
malloc
((
unsigned
) (
strlen
(
s
)+
1
));
20
if
(
cp
) {
21
(
void
)
strcpy
(
cp
,
s
);
22
}
23
}
else
{
24
cp
= (
char
*)
NULL
;
25
}
26
return
(
cp
);
27
}
28
#else
29
int
strdup_bs
;
30
#endif