mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	use reallocarray instead of calloc; avoid the zero before infill
ok nicm
This commit is contained in:
		
							
								
								
									
										2
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								grid.c
									
									
									
									
									
								
							@@ -657,7 +657,7 @@ grid_duplicate_lines(struct grid *dst, u_int dy, struct grid *src, u_int sy,
 | 
			
		||||
 | 
			
		||||
		memcpy(dstl, srcl, sizeof *dstl);
 | 
			
		||||
		if (srcl->cellsize != 0) {
 | 
			
		||||
			dstl->celldata = xcalloc(
 | 
			
		||||
			dstl->celldata = xreallocarray(NULL,
 | 
			
		||||
			    srcl->cellsize, sizeof *dstl->celldata);
 | 
			
		||||
			memcpy(dstl->celldata, srcl->celldata,
 | 
			
		||||
			    srcl->cellsize * sizeof *dstl->celldata);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user