From 9e993c50e63955f4671ff26ec83ed516522b42e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Fri, 7 Jul 2023 10:41:12 +0200 Subject: xC: don't crash with unknown terminals It would be possible to avoid using cur_term fields in this case, but the program would likely be of little use anyway. --- xC.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xC.c b/xC.c index ea033e0..5d3eb67 100644 --- a/xC.c +++ b/xC.c @@ -16091,7 +16091,11 @@ main (int argc, char *argv[]) // The following part is a bit brittle because of interdependencies init_colors (&ctx); - if (format_mode) format_input_and_die (&ctx); + if (format_mode) + format_input_and_die (&ctx); + if (!cur_term) + exit_fatal ("terminal initialization failed"); + init_global_buffer (&ctx); show_logo (&ctx); setup_signal_handlers (); -- cgit v1.2.3