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 --- hunt/hunt/hunt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hunt') diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c index 780eaa29..aecaa308 100644 --- a/hunt/hunt/hunt.c +++ b/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.c,v 1.26 2008/01/28 03:23:29 dholland Exp $ */ +/* $NetBSD: hunt.c,v 1.27 2008/08/08 16:10:47 drochner Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hunt.c,v 1.26 2008/01/28 03:23:29 dholland Exp $"); +__RCSID("$NetBSD: hunt.c,v 1.27 2008/08/08 16:10:47 drochner Exp $"); #endif /* not lint */ # include @@ -259,7 +259,8 @@ main(ac, av) if (!isatty(0) || (term = getenv("TERM")) == NULL) errx(1, "no terminal type"); # ifdef USE_CURSES - initscr(); + if (!initscr()) + errx(0, "couldn't initialize screen"); (void) noecho(); (void) cbreak(); # else /* !USE_CURSES */ -- cgit v1.2.3-56-ge451