diff options
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include "util.h" +#include "execinfo.h" #include "ncurses.h" #include <stdarg.h> @@ -40,6 +41,14 @@ done: } void +panic(const char *msg, const char *file, int line) +{ + endwin(); + fprintf(stderr, "Panic at %s:%i (%s)\n", file, line, msg); + exit(1); +} + +void assert(int cond, const char *file, int line, const char *condstr) { if (cond) return; |
