summaryrefslogtreecommitdiff
path: root/games/larn/io.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-05-30 02:23:18 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-05-30 02:23:18 +0000
commitc37a824a5731bbf062ef51886e87e3518150da78 (patch)
tree2cec83a38c04242325f3bd21e510c0319fe52d26 /games/larn/io.c
parent43007dc359f95c901be348fc1b2a2d4ea237cb0e (diff)
use standard isalpha() and isdigit(); check that screen is big enough;
correct a typo, and fix up some man page paths.
Diffstat (limited to 'games/larn/io.c')
-rw-r--r--games/larn/io.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/games/larn/io.c b/games/larn/io.c
index fd5480a21cc..2fa92111e92 100644
--- a/games/larn/io.c
+++ b/games/larn/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.5 1999/03/27 03:45:49 pjanzen Exp $ */
+/* $OpenBSD: io.c,v 1.6 1999/05/30 02:23:16 pjanzen Exp $ */
/* $NetBSD: io.c,v 1.7 1997/10/18 20:03:26 christos Exp $ */
/*
@@ -61,11 +61,12 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: io.c,v 1.5 1999/03/27 03:45:49 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: io.c,v 1.6 1999/05/30 02:23:16 pjanzen Exp $";
#endif /* not lint */
#include "header.h"
#include "extern.h"
+#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
@@ -783,6 +784,7 @@ init_term()
char termbuf[1024];
char *capptr = cap + 10;
char *term;
+ int co, li;
switch (tgetent(termbuf, term = getenv("TERM"))) {
case -1:
@@ -805,6 +807,8 @@ init_term()
SO = tgetstr("so", &capptr); /* Begin standout mode */
SE = tgetstr("se", &capptr); /* End standout mode */
CD = tgetstr("cd", &capptr); /* Clear to end of display */
+ co = tgetnum("co"); /* columns */
+ li = tgetnum("li"); /* lines */
if (!CM) { /* can't find cursor motion entry */
write(2, "Sorry, for a ", 13);
@@ -824,6 +828,10 @@ init_term()
write(2, ", I can't find the clear entire screen entry in termcap\n", 56);
exit(1);
}
+ if (co < 80 || li < 25) {
+ write(2, "Sorry, screen too small (80x25 min)\n", 36);
+ exit(1);
+ }
if ((outbuf = malloc(BUFBIG + 16)) == 0) { /* get memory for
* decoded output buffer */
write(2, "Error malloc'ing memory for decoded output buffer\n", 50);