mirror of
https://github.com/tmux/tmux.git
synced 2025-01-18 03:46:14 +00:00
Do not free more lines than are available in the history.
This commit is contained in:
parent
70bc07a358
commit
6fdaaa0637
4
grid.c
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user