diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-06-23 23:04:34 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-06-23 23:04:34 +0000 |
commit | f75b9fc5324b92893cd3961e09583fa91c25e2f0 (patch) | |
tree | 7259bdb33b6b56dba2f13add1529c7e5e8993e65 | |
parent | 226782657bcf8cb74d584851cc8521fe11280537 (diff) |
Make sure screen is big enough to play.
-rw-r--r-- | games/bs/bs.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/games/bs/bs.c b/games/bs/bs.c index 98fda869701..affb871ed73 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs.c,v 1.10 2001/02/17 23:00:05 pjanzen Exp $ */ +/* $OpenBSD: bs.c,v 1.11 2001/06/23 23:04:33 pjanzen Exp $ */ /* * bs.c - original author: Bruce Holloway * salvo option by: Chuck A DeGaul @@ -11,20 +11,21 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: bs.c,v 1.10 2001/02/17 23:00:05 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: bs.c,v 1.11 2001/06/23 23:04:33 pjanzen Exp $"; #endif /* #define _POSIX_SOURCE */ /* (setegid, random) */ #include <sys/param.h> +#include <sys/types.h> #include <curses.h> -#include <signal.h> #include <ctype.h> +#include <err.h> +#include <signal.h> #include <stdlib.h> -#include <sys/types.h> -#include <unistd.h> #include <string.h> #include <time.h> +#include <unistd.h> #ifndef A_UNDERLINE /* BSD curses */ #define beep() write(1,"\007",1); @@ -242,6 +243,11 @@ static void intro(void) (void)cbreak(); (void)noecho(); + if ((LINES < PROMPTLINE + 3) || (COLS < COLWIDTH)) { + endwin(); + errx(1, "screen must be at least %dx%d.", PROMPTLINE + 3, COLWIDTH); + } + #ifdef PENGUIN #define PR (void)addstr (void)clear(); |