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 --- atc/graphics.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'atc') diff --git a/atc/graphics.c b/atc/graphics.c index 9d9ba6fb..c29b2674 100644 --- a/atc/graphics.c +++ b/atc/graphics.c @@ -1,4 +1,4 @@ -/* $NetBSD: graphics.c,v 1.14 2007/12/15 19:44:38 perry Exp $ */ +/* $NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -46,7 +46,7 @@ #if 0 static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: graphics.c,v 1.14 2007/12/15 19:44:38 perry Exp $"); +__RCSID("$NetBSD: graphics.c,v 1.15 2008/08/08 16:10:47 drochner Exp $"); #endif #endif /* not lint */ @@ -115,7 +115,8 @@ init_gr(void) { static char buffer[BUFSIZ]; - (void)initscr(); + if (!initscr()) + errx(0, "couldn't initialize screen"); setbuf(stdout, buffer); input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0); credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES, -- cgit v1.2.3-56-ge451