From 55e721da42bb57833e9c99e2b87cf50d6c035f07 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 8 Feb 2020 02:13:02 -0500 Subject: Check return values of newwin/newpad --- ui.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); } -- cgit 1.4.1 ref='/src/tree/port/cgram?id=a0478e1e2d3513c3d6c47963e7c02ba6c598c06c'>tree commit diff
path: root/port/cgram (unfollow)
Commit message (Collapse)Author
2019-07-14Add CSI names to shotty -dJune McEnroe
2019-07-14Ignore CSI tJune McEnroe
2019-07-14Add more info to shotty man pageJune McEnroe
2019-07-14Fix OSC PT handlingJune McEnroe
Undo gone wrong!
2019-07-14Handle OSC in shottyJune McEnroe
2019-07-14Add shotty -dJune McEnroe
2019-07-13Add shotty -cJune McEnroe
2019-07-13Add DL to shottyJune McEnroe
2019-07-12Color html rather than bodyJune McEnroe
If background-color is only set on body then overscroll in Safari reveals white.
2019-07-12Make author consistent and update URLsJune McEnroe
2019-07-12Move to www/text.causal.agencyJune McEnroe
2019-07-12Add new causal.agency with shotty shotsJune McEnroe
2019-07-12Use -s to infer terminal sizeJune McEnroe
2019-07-12Add DCH to shottyJune McEnroe
This makes htop mostly work. Scrolling region still missing.
2019-07-12Support insert mode in shottyJune McEnroe
This is how curses puts characters into the bottom-right cell of the terminal.
2019-07-11Don't do carriage return on line feedJune McEnroe
2019-07-11Interpret 256color-style SGRsJune McEnroe
2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe
2019-07-11Factor out clearJune McEnroe
2019-07-11Add bright option to shottyJune McEnroe
2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe
2019-07-10Ignore SM and RMJune McEnroe
2019-07-09Add shotty man page and build itJune McEnroe
2019-07-09Add up -cJune McEnroe
2019-07-09Add options for default colors to shottyJune McEnroe
2019-07-08Use char literals consistentlyJune McEnroe