diff options
| author | drochner <drochner@NetBSD.org> | 2008-08-08 16:10:47 +0000 |
|---|---|---|
| committer | drochner <drochner@NetBSD.org> | 2008-08-08 16:10:47 +0000 |
| commit | 432ec04420e36d6dc6d2629157aeed54d795ea21 (patch) | |
| tree | 271dc50d7d1b48f9da59ccaa51f94e43d72d49c1 /games/worms | |
| parent | 4578c8e43439cbee589559d80ad041aa1a408d85 (diff) | |
if initscr() fails, exit with a message rather than crash in the
next curses call
Diffstat (limited to 'games/worms')
| -rw-r--r-- | games/worms/worms.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/games/worms/worms.c b/games/worms/worms.c index e6b85229780..f5a600ddcb5 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -1,4 +1,4 @@ -/* $NetBSD: worms.c,v 1.18 2008/07/20 01:03:22 lukem Exp $ */ +/* $NetBSD: worms.c,v 1.19 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[] = "@(#)worms.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: worms.c,v 1.18 2008/07/20 01:03:22 lukem Exp $"); +__RCSID("$NetBSD: worms.c,v 1.19 2008/08/08 16:10:47 drochner Exp $"); #endif #endif /* not lint */ @@ -237,7 +237,8 @@ main(argc, argv) if (!(worm = malloc((size_t)number * sizeof(struct worm))) || !(mp = malloc((size_t)1024))) nomem(); - initscr(); + if (!initscr()) + errx(0, "couldn't initialize screen"); curs_set(0); CO = COLS; LI = LINES; |
