From 8218dc5ff267a1066f10d1dc24a259770c7e1257 Mon Sep 17 00:00:00 2001 From: drochner Date: Fri, 8 Aug 2008 16:10:47 +0000 Subject: if initscr() fails, exit with a message rather than crash in the next curses call --- phantasia/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phantasia') diff --git a/phantasia/main.c b/phantasia/main.c index 11dc6fb1..996622ed 100644 --- a/phantasia/main.c +++ b/phantasia/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.16 2006/05/13 22:29:53 christos Exp $ */ +/* $NetBSD: main.c,v 1.17 2008/08/08 16:10:47 drochner Exp $ */ /* * Phantasia 3.3.2 -- Interterminal fantasy game @@ -995,7 +995,10 @@ playinit() signal(SIGPIPE, ill_sig); #endif - initscr(); /* turn on curses */ + if (!initscr()) { /* turn on curses */ + fprintf(stderr, "couldn't initialize screen\n"); + exit (0); + } noecho(); /* do not echo input */ cbreak(); /* do not process erase, kill */ clear(); -- cgit v1.2.3-56-ge451