diff options
author | nicm <nicm> | 2017-09-11 06:40:46 +0000 |
---|---|---|
committer | nicm <nicm> | 2017-09-11 06:40:46 +0000 |
commit | 6fdaaa06372302f0c35e128d34a9fbd19de9cd00 (patch) | |
tree | ef76f4d626b9dc8a8b9ac003896ea089b1c220d3 | |
parent | 70bc07a35831d653f83395cc351066a5a7c1256d (diff) | |
download | rtmux-6fdaaa06372302f0c35e128d34a9fbd19de9cd00.tar.gz rtmux-6fdaaa06372302f0c35e128d34a9fbd19de9cd00.tar.bz2 rtmux-6fdaaa06372302f0c35e128d34a9fbd19de9cd00.zip |
Do not free more lines than are available in the history.
-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 |