summaryrefslogtreecommitdiffstats
path: root/snake
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 /snake
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 'snake')
-rw-r--r--snake/snake/snake.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/snake/snake/snake.c b/snake/snake/snake.c
index 6d7ebb87..cac56136 100644
--- a/snake/snake/snake.c
+++ b/snake/snake/snake.c
@@ -1,4 +1,4 @@
-/* $NetBSD: snake.c,v 1.24 2008/07/20 01:03:22 lukem Exp $ */
+/* $NetBSD: snake.c,v 1.25 2008/08/08 16:10:47 drochner Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94";
#else
-__RCSID("$NetBSD: snake.c,v 1.24 2008/07/20 01:03:22 lukem Exp $");
+__RCSID("$NetBSD: snake.c,v 1.25 2008/08/08 16:10:47 drochner Exp $");
#endif
#endif /* not lint */
@@ -191,7 +191,8 @@ main(argc, argv)
srandom((int) tv);
penalty = loot = 0;
- initscr();
+ if (!initscr())
+ errx(0, "couldn't initialize screen");;
cbreak();
noecho();
#ifdef KEY_LEFT