diff --git a/usr.sbin/sushi/C.msg b/usr.sbin/sushi/C.msg index 32687cbd61f1..f2f8cc685137 100644 --- a/usr.sbin/sushi/C.msg +++ b/usr.sbin/sushi/C.msg @@ -20,6 +20,8 @@ $set 1 errors 19 No menu hierchy found. 20 Bad keybinding 21 Bad keyword in config file +22 Cannot initialize curses +23 failed to allocate bottomhelp window $set 2 labels 1 F1=Help 2 F2=Refresh diff --git a/usr.sbin/sushi/blabel.c b/usr.sbin/sushi/blabel.c index f9b1cb7357cc..934606aac62a 100644 --- a/usr.sbin/sushi/blabel.c +++ b/usr.sbin/sushi/blabel.c @@ -1,4 +1,4 @@ -/* $NetBSD: blabel.c,v 1.7 2001/01/10 10:00:29 garbled Exp $ */ +/* $NetBSD: blabel.c,v 1.8 2001/01/14 21:23:23 garbled Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -80,6 +80,9 @@ bottom_help(int type) label[i] = strdup(keylabel[i]); labelwin = subwin(stdscr, 2, ws.ws_col, ws.ws_row-2, 0); + if (labelwin == NULL) + bailout("%s", catgets(catalog, 1, 23, + "failed to allocate bottomhelp window")); wattron(labelwin, A_BOLD); for (i=0,j=0; i < 10; i+=2, j+=17) diff --git a/usr.sbin/sushi/sushi.c b/usr.sbin/sushi/sushi.c index c5dbc5621933..556c5e82e9c3 100644 --- a/usr.sbin/sushi/sushi.c +++ b/usr.sbin/sushi/sushi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sushi.c,v 1.6 2001/01/10 10:00:29 garbled Exp $ */ +/* $NetBSD: sushi.c,v 1.7 2001/01/14 21:23:23 garbled Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -105,7 +105,10 @@ main(int argc, char **argv) } } - initscr(); + if (initscr() == NULL) + bailout("%s", catgets(catalog, 1, 22, + "Cannot initialize curses")); + cdkscreen = initCDKScreen(stdscr); ioctl(0, TIOCGWINSZ, &ws); @@ -242,7 +245,8 @@ parse_config(void) if (searchpaths[i] == NULL) bailout("malloc: %s", strerror(errno)); if (getenv("HOME") != NULL) { - searchpaths[i] = strcat(getenv("HOME"), "/sushi"); + strcpy(searchpaths[i], getenv("HOME")); + strcat(searchpaths[i], "/sushi"); i++; } searchpaths[i] = NULL;