diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2021-04-13 15:39:22 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2021-04-13 15:39:22 +0000 |
commit | c4e75e087b8b64d0f62aeb2875d6e4e9716bbf54 (patch) | |
tree | b4f71df650f97ecc57046327fd29361dd800ff85 /usr.bin/vi/common | |
parent | 2e89c379ae7dd9fcc57b81b87a2593ee5ad291f4 (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.c | 4 |
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 */ |