UINT_MAX.

This commit is contained in:
Nicholas Marriott
2008-09-29 16:58:02 +00:00
parent 8132b4d092
commit 9d6827ebb2
2 changed files with 9 additions and 3 deletions

View File

@ -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>
@ -31,7 +31,7 @@
#define ARRAY_INITIALSPACE(a) (10 * ARRAY_ITEMSIZE(a))
#define ARRAY_ENSURE(a, n) do { \
if (SIZE_MAX - (n) < (a)->num) \
if (UINT_MAX - (n) < (a)->num) \
fatalx("number too big"); \
if (SIZE_MAX / ((a)->num + (n)) < ARRAY_ITEMSIZE(a)) \
fatalx("size too big"); \