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 --- canfield/canfield/canfield.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'canfield') diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c index 54111c02..be6f35b5 100644 --- a/canfield/canfield/canfield.c +++ b/canfield/canfield/canfield.c @@ -1,4 +1,4 @@ -/* $NetBSD: canfield.c,v 1.24 2008/07/20 01:03:21 lukem Exp $ */ +/* $NetBSD: canfield.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[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: canfield.c,v 1.24 2008/07/20 01:03:21 lukem Exp $"); +__RCSID("$NetBSD: canfield.c,v 1.25 2008/08/08 16:10:47 drochner Exp $"); #endif #endif /* not lint */ @@ -1774,7 +1774,10 @@ main(void) signal(SIGINT, askquit); signal(SIGHUP, cleanup); signal(SIGTERM, cleanup); - initscr(); + if (!initscr()) { + fprintf(stderr, "couldn't initialize screen\n"); + exit (0); + } raw(); noecho(); initall(); -- cgit v1.2.3-56-ge451