repo.or.cz
/
cnoor.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
quran: don't use mmap()
[cnoor.git]
/
util.c
blob
9ac45ca5eec3664ab7fe7f9cb6ad78e302b74667
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
void
*
xmalloc
(
size_t
size
)
5
{
6
void
*
value
=
malloc
(
size
);
7
if
(!
value
) {
8
fprintf
(
stderr
,
"Out of memory!
\n
"
);
9
exit
(
1
);
10
}
11
return
value
;
12
}
13
14
void
*
xerror
(
char
*
errmsg
)
15
{
16
perror
(
errmsg
);
17
exit
(
1
);
18
}