#include "util.h" void *die(char *text) { printf("dieing: %s\n", text); exit(1); } void *xmalloc(unsigned int size) { void *mem = malloc(size); if(mem == NULL) die("out of memory"); else return mem; } void *xrealloc(void *data, unsigned int size) { void *mem = realloc(data, size); if(mem == NULL) die("out of memory"); else return mem; }