From f75b9fc5324b92893cd3961e09583fa91c25e2f0 Mon Sep 17 00:00:00 2001 From: Paul Janzen Date: Sat, 23 Jun 2001 23:04:34 +0000 Subject: Make sure screen is big enough to play. --- games/bs/bs.c | 16 +++++++++++----- 1 file 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 +#include #include -#include #include +#include +#include #include -#include -#include #include #include +#include #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(); -- cgit v1.2.3