summaryrefslogtreecommitdiffstats
path: root/atc
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2008-08-08 16:10:47 +0000
committerdrochner <drochner@NetBSD.org>2008-08-08 16:10:47 +0000
commit8218dc5ff267a1066f10d1dc24a259770c7e1257 (patch)
tree0cb722dff6cd475d71113cb6ee9ef928f9ee3b17 /atc
parent4ca7662068dbec217082e73d01ea38705f82833b (diff)
downloadbsdgames-darwin-8218dc5ff267a1066f10d1dc24a259770c7e1257.tar.gz
bsdgames-darwin-8218dc5ff267a1066f10d1dc24a259770c7e1257.tar.zst
bsdgames-darwin-8218dc5ff267a1066f10d1dc24a259770c7e1257.zip
if initscr() fails, exit with a message rather than crash in the
next curses call
Diffstat (limited to 'atc')
-rw-r--r--atc/graphics.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/atc/graphics.c b/atc/graphics.c
index 9d9ba6fb..c29b2674 100644
--- a/atc/graphics.c
+++ b/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $NetBSD: graphics.c,v 1.14 2007/12/15 19:44:38 perry Exp $ */
+/* $NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: graphics.c,v 1.14 2007/12/15 19:44:38 perry Exp $");
+__RCSID("$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $");
#endif
#endif /* not lint */
@@ -115,7 +115,8 @@ init_gr(void)
{
static char buffer[BUFSIZ];
- (void)initscr();
+ if (!initscr())
+ errx(0, "couldn't initialize screen");
setbuf(stdout, buffer);
input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0);
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,