#include #include #include void mallocfail() { endwin(); fprintf(stderr, "Failed to allocate memory\n"); exit(1); }