summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-17 18:35:11 +0000
committernicm <nicm@openbsd.org>2009-07-17 18:35:11 +0000
commit7e4d386b53938d231e90440544f71a6c99f7970d (patch)
treed5aa70567ceb4c02890f1670b7559ac75e51bf2f
parentUpdate bus_dma to the better codebase found on almost all other platforms, (diff)
downloadwireguard-openbsd-7e4d386b53938d231e90440544f71a6c99f7970d.tar.xz
wireguard-openbsd-7e4d386b53938d231e90440544f71a6c99f7970d.zip
When resizing a screen smaller in alternate screen mode, all the lines needed
could be consumed by deleting from the bottom, leaving none to be removed from the top. In this case, don't call grid_view_delete_lines with ny of 0 as this is incorrect and causes a bounds check to fatal error if built with -DDEBUG.
-rw-r--r--usr.bin/tmux/screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c
index af09daf2b92..0f78ad76439 100644
--- a/usr.bin/tmux/screen.c
+++ b/usr.bin/tmux/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.8 2009/07/13 10:43:52 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.9 2009/07/17 18:35:11 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -183,7 +183,7 @@ screen_resize_y(struct screen *s, u_int sy)
available = s->cy;
if (gd->flags & GRID_HISTORY)
gd->hsize += needed;
- else if (available > 0) {
+ else if (needed > 0 && available > 0) {
if (available > needed)
available = needed;
grid_view_delete_lines(gd, 0, available);