summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util.c b/src/util.c
index b2a36bb..edc20a0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,9 +1,9 @@
#define _XOPEN_SOURCE 600
#include "util.h"
+#include "tui.h"
-#include "execinfo.h"
-#include "ncurses.h"
+#include <execinfo.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -45,7 +45,8 @@ panic(const char *file, int line, const char *msg, ...)
{
va_list ap;
- endwin();
+ tui_restore();
+
fprintf(stderr, "Panic at %s:%i (", file, line);
va_start(ap, msg);
vfprintf(stderr, msg, ap);
@@ -60,8 +61,10 @@ assert(int cond, const char *file, int line, const char *condstr)
{
if (cond) return;
- endwin();
+ tui_restore();
+
fprintf(stderr, "Assertion failed %s:%i (%s)\n", file, line, condstr);
+
exit(1);
}