From c2da57e3a40347ed0d7d20fa9509b38919835b55 Mon Sep 17 00:00:00 2001 From: millert Date: Tue, 13 Apr 2021 15:39:21 +0000 Subject: [PATCH] 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. --- usr.bin/vi/common/options.c | 4 ++-- 1 file 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 */ -- 2.20.1