diff options
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |