summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index e8c0935..c91f944 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;