repo.or.cz
/
ctxt.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
html: put a new line after body
[ctxt.git]
/
util.c
blob
4717e2b2918e8c7888e9fc8679e9a2a6e2d0d888
1
#include <stdlib.h>
2
#include <unistd.h>
3
4
void
die
(
char
*
msg
)
5
{
6
write
(
STDERR_FILENO
,
msg
,
strlen
(
msg
));
7
exit
(
1
);
8
}
9
10
void
*
xmalloc
(
size_t
size
)
11
{
12
void
*
value
=
malloc
(
size
);
13
if
(!
value
)
14
die
(
"Out of memory!
\n
"
);
15
return
value
;
16
}