summaryrefslogtreecommitdiffstats
path: root/boggle
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 /boggle
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 'boggle')
-rw-r--r--boggle/boggle/mach.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/boggle/boggle/mach.c b/boggle/boggle/mach.c
index e8a481c2..aaaacbbb 100644
--- a/boggle/boggle/mach.c
+++ b/boggle/boggle/mach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mach.c,v 1.17 2007/12/15 19:44:39 perry Exp $ */
+/* $NetBSD: mach.c,v 1.18 2008/08/08 16:10:47 drochner Exp $ */
/*-
* Copyright (c) 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93";
#else
-__RCSID("$NetBSD: mach.c,v 1.17 2007/12/15 19:44:39 perry Exp $");
+__RCSID("$NetBSD: mach.c,v 1.18 2008/08/08 16:10:47 drochner Exp $");
#endif
#endif /* not lint */
@@ -558,7 +558,10 @@ prompt(const char *mesg)
static int
tty_setup(void)
{
- initscr();
+ if (!initscr()) {
+ fprintf(stderr, "couldn't initialize screen\n");
+ exit (0);
+ }
raw();
noecho();