diff options
author | drochner <drochner@NetBSD.org> | 2008-08-08 16:10:47 +0000 |
---|---|---|
committer | drochner <drochner@NetBSD.org> | 2008-08-08 16:10:47 +0000 |
commit | 8218dc5ff267a1066f10d1dc24a259770c7e1257 (patch) | |
tree | 0cb722dff6cd475d71113cb6ee9ef928f9ee3b17 /rogue | |
parent | 4ca7662068dbec217082e73d01ea38705f82833b (diff) | |
download | bsdgames-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 'rogue')
-rw-r--r-- | rogue/init.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/rogue/init.c b/rogue/init.c index 0bb3d3b0..982a95cb 100644 --- a/rogue/init.c +++ b/rogue/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.17 2008/01/14 03:50:01 dholland Exp $ */ +/* $NetBSD: init.c,v 1.18 2008/08/08 16:10:47 drochner Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: init.c,v 1.17 2008/01/14 03:50:01 dholland Exp $"); +__RCSID("$NetBSD: init.c,v 1.18 2008/08/08 16:10:47 drochner Exp $"); #endif #endif /* not lint */ @@ -113,7 +113,10 @@ init(int argc, char *argv[]) fflush(stdout); } - initscr(); + if (!initscr()) { + fprintf(stderr, "couldn't initialize screen\n"); + exit (0); + } if ((LINES < DROWS) || (COLS < DCOLS)) { clean_up("must be played on at least 80 x 24 screen"); } |