aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2017-09-11 10:08:15 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2017-09-11 10:08:15 +0100
commit495e2ed17f1d7b4efbb0f25a6bb8e8d82c6ea7c9 (patch)
treef3a83b856acc27e6914b2624cce5c434fc0999fb /grid.c
parent034b19b734a25d00fd27245412b0cde6b340482e (diff)
parentd8c397d1b7c4c3643c0b4bce0ea7674904a98d49 (diff)
downloadrtmux-495e2ed17f1d7b4efbb0f25a6bb8e8d82c6ea7c9.tar.gz
rtmux-495e2ed17f1d7b4efbb0f25a6bb8e8d82c6ea7c9.tar.bz2
rtmux-495e2ed17f1d7b4efbb0f25a6bb8e8d82c6ea7c9.zip
Merge branch 'master' into 2.6-rc
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/grid.c b/grid.c
index c26db476..aa9aea4c 100644
--- a/grid.c
+++ b/grid.c
@@ -292,12 +292,14 @@ grid_collect_history(struct grid *gd)
{
u_int ny;
- if (gd->hsize < gd->hlimit)
+ if (gd->hsize == 0 || gd->hsize < gd->hlimit)
return;
ny = gd->hlimit / 10;
if (ny < 1)
ny = 1;
+ if (ny > gd->hsize)
+ ny = gd->hsize;
/*
* Free the lines from 0 to ny then move the remaining lines over