repo.or.cz
/
tftp-hpa.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Use replacement library functions to daemonize, rather than #ifdef hell
[tftp-hpa.git]
/
lib
/
xstrdup.c
blob
5d65b7e0d2bb285920f002f1708e6959dbd3d838
1
/*
2
* xstrdup.c
3
*
4
* Simple error-checking version of strdup()
5
*
6
*/
7
8
#include <stdlib.h>
9
#include <string.h>
10
#include <stdio.h>
11
12
char
*
xstrdup
(
const char
*
s
)
13
{
14
char
*
p
=
strdup
(
s
);
15
16
if
( !
p
) {
17
fprintf
(
stderr
,
"Out of memory!
\n
"
);
18
exit
(
128
);
19
}
20
21
return
p
;
22
}