1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2026-05-06 22:39:37 +00:00

* zic.c (growalloc): Fix typos in size calculation and diagnostic.

This commit is contained in:
Paul Eggert
2014-03-20 20:21:43 -07:00
parent b979bceed1
commit feb4476d27

4
zic.c
View File

@@ -400,8 +400,8 @@ growalloc(void *ptr, size_t itemsize, int nitems, int *nitems_alloc)
return ptr;
else {
int amax = INT_MAX < SIZE_MAX ? INT_MAX : SIZE_MAX;
if ((amax - 1) / 2 < *nitems_alloc)
memory_exhausted("int ooverflow");
if ((amax - 1) / 3 * 2 < *nitems_alloc)
memory_exhausted("int overflow");
*nitems_alloc = *nitems_alloc + (*nitems_alloc >> 1) + 1;
return erealloc(ptr, size_product(*nitems_alloc, itemsize));
}