quran: don't use mmap()
[cnoor.git] / util.c
blob9ac45ca5eec3664ab7fe7f9cb6ad78e302b74667
1 #include <stdio.h>
2 #include <stdlib.h>
4 void *xmalloc(size_t size)
6 void *value = malloc(size);
7 if (!value) {
8 fprintf(stderr, "Out of memory!\n");
9 exit(1);
11 return value;
14 void *xerror(char *errmsg)
16 perror(errmsg);
17 exit(1);