summaryrefslogtreecommitdiff
path: root/usr.bin/vi/common
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2021-04-13 15:39:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2021-04-13 15:39:22 +0000
commitc4e75e087b8b64d0f62aeb2875d6e4e9716bbf54 (patch)
treeb4f71df650f97ecc57046327fd29361dd800ff85 /usr.bin/vi/common
parent2e89c379ae7dd9fcc57b81b87a2593ee5ad291f4 (diff)
Require that the argument to the window option be non-zero.
A zero-row window would not be usable (no room to edit) and the code is full of assumptions that "sp->t_rows - 1" >= 0. From Erik Ruotsalainen, fixes a bug reported by Paul de Weerd.
Diffstat (limited to 'usr.bin/vi/common')
-rw-r--r--usr.bin/vi/common/options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vi/common/options.c b/usr.bin/vi/common/options.c
index d921afef311..ce80e7b2d70 100644
--- a/usr.bin/vi/common/options.c
+++ b/usr.bin/vi/common/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.28 2020/04/30 10:40:21 millert Exp $ */
+/* $OpenBSD: options.c,v 1.29 2021/04/13 15:39:21 millert Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -182,7 +182,7 @@ OPTLIST const optlist[] = {
/* O_WARN 4BSD */
{"warn", NULL, OPT_1BOOL, 0},
/* O_WINDOW 4BSD */
- {"window", f_window, OPT_NUM, 0},
+ {"window", f_window, OPT_NUM, OPT_NOZERO},
/* O_WINDOWNAME 4BSD */
{"windowname", NULL, OPT_0BOOL, 0},
/* O_WRAPLEN 4.4BSD */