summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-07-17 18:35:55 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-07-17 18:35:55 +0000
commit21cfef45d6f2774bd3e0868eb085b2f0fccb8112 (patch)
tree120f993a284564535e57569e9a7a575ebc1f9b41 /screen.c
parentae7dda10ceaf340fdeb4b365b79ca77789ebd844 (diff)
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.
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/screen.c b/screen.c
index 02089ff5..aae659c0 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.92 2009-07-14 06:40:33 nicm Exp $ */
+/* $Id: screen.c,v 1.93 2009-07-17 18:35:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -182,7 +182,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);