repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
. service tells you which device it couldn't stat
[minix3.git]
/
lib
/
other
/
strdup.c
blob
62969cbaa6084688b26b046a03c7c53bbeab99a9
1
/*
2
lib/other/strdup.c
3
*/
4
5
#include <stdlib.h>
6
#include <string.h>
7
8
char
*
strdup
(
s1
)
9
const char
*
s1
;
10
{
11
size_t
len
;
12
char
*
s2
;
13
14
len
=
strlen
(
s1
)+
1
;
15
16
s2
=
malloc
(
len
);
17
if
(
s2
==
NULL
)
18
return
NULL
;
19
strcpy
(
s2
,
s1
);
20
21
return
s2
;
22
}
23