mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Do not free more lines than are available in the history.
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user