mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	UINT_MAX.
This commit is contained in:
		
							
								
								
									
										4
									
								
								array.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								array.h
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: array.h,v 1.6 2008-08-07 20:20:52 nicm Exp $ */
 | 
					/* $Id: array.h,v 1.7 2008-09-29 16:58:02 nicm Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -31,7 +31,7 @@
 | 
				
			|||||||
#define ARRAY_INITIALSPACE(a) (10 * ARRAY_ITEMSIZE(a))
 | 
					#define ARRAY_INITIALSPACE(a) (10 * ARRAY_ITEMSIZE(a))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ARRAY_ENSURE(a, n) do {						\
 | 
					#define ARRAY_ENSURE(a, n) do {						\
 | 
				
			||||||
	if (SIZE_MAX - (n) < (a)->num)					\
 | 
						if (UINT_MAX - (n) < (a)->num)					\
 | 
				
			||||||
		fatalx("number too big");				\
 | 
							fatalx("number too big");				\
 | 
				
			||||||
	if (SIZE_MAX / ((a)->num + (n)) < ARRAY_ITEMSIZE(a))		\
 | 
						if (SIZE_MAX / ((a)->num + (n)) < ARRAY_ITEMSIZE(a))		\
 | 
				
			||||||
		fatalx("size too big");					\
 | 
							fatalx("size too big");					\
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								screen.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								screen.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: screen.c,v 1.73 2008-09-26 06:45:26 nicm Exp $ */
 | 
					/* $Id: screen.c,v 1.74 2008-09-29 16:58:02 nicm Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -93,6 +93,9 @@ screen_resize_x(struct screen *s, u_int sx)
 | 
				
			|||||||
	const struct grid_cell	*gc;
 | 
						const struct grid_cell	*gc;
 | 
				
			||||||
	u_int			 xx, yy;
 | 
						u_int			 xx, yy;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (sx == 0)
 | 
				
			||||||
 | 
							fatalx("zero size");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* If getting larger, not much to do. */
 | 
						/* If getting larger, not much to do. */
 | 
				
			||||||
	if (sx > screen_size_x(s)) {
 | 
						if (sx > screen_size_x(s)) {
 | 
				
			||||||
		gd->sx = sx;
 | 
							gd->sx = sx;
 | 
				
			||||||
@@ -129,6 +132,9 @@ screen_resize_y(struct screen *s, u_int sy)
 | 
				
			|||||||
	struct grid_data	*gd = s->grid;
 | 
						struct grid_data	*gd = s->grid;
 | 
				
			||||||
	u_int			 oy, yy, ny;
 | 
						u_int			 oy, yy, ny;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (sy == 0)
 | 
				
			||||||
 | 
							fatalx("zero size");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Size decreasing. */
 | 
						/* Size decreasing. */
 | 
				
			||||||
	if (sy < screen_size_y(s)) {
 | 
						if (sy < screen_size_y(s)) {
 | 
				
			||||||
		oy = screen_size_y(s);
 | 
							oy = screen_size_y(s);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user