summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-08 02:13:02 -0500
committerJune McEnroe <june@causal.agency>2020-02-08 02:13:02 -0500
commit55e721da42bb57833e9c99e2b87cf50d6c035f07 (patch)
tree0216a2a33fbd45f054667fa4275c115cb077e6c7 /ui.c
parentAdd /query (diff)
downloadcatgirl-55e721da42bb57833e9c99e2b87cf50d6c035f07.tar.gz
catgirl-55e721da42bb57833e9c99e2b87cf50d6c035f07.zip
Check return values of newwin/newpad
Diffstat (limited to '')
-rw-r--r--ui.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index e9ca3ef..6d1338b 100644
--- a/ui.c
+++ b/ui.c
@@ -109,6 +109,7 @@ static struct Window *windowFor(size_t id) {
 
 	window->id = id;
 	window->pad = newpad(BufferCap, COLS);
+	if (!window->pad) err(EX_OSERR, "newpad");
 	scrollok(window->pad, true);
 	wmove(window->pad, BufferCap - 1, 0);
 	window->scroll = BufferCap;
@@ -211,20 +212,25 @@ void uiInit(void) {
 	disableFlowControl();
 	def_prog_mode();
 	atexit(errExit);
+	colorInit();
 
 	if (!to_status_line && !strncmp(termname(), "xterm", 5)) {
 		to_status_line = "\33]2;";
 		from_status_line = "\7";
 	}
+
 #define X(id, seq) define_key(seq, id);
 	ENUM_KEY
 #undef X
 
-	colorInit();
 	status = newwin(1, COLS, 0, 0);
+	if (!status) err(EX_OSERR, "newwin");
+
 	input = newpad(1, 512);
+	if (!input) err(EX_OSERR, "newpad");
 	keypad(input, true);
 	nodelay(input, true);
+
 	windows.active = windowFor(Network);
 	uiShow();
 }
a>June McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe