aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-10-19 23:32:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-10-19 23:32:43 -0400
commit9937088b26eef7bbe27a9bb5f497aa6307fded5c (patch)
tree32baa6eb894a2a70f1f72d0f86f325a991698d71 /src
parent9ee22f1ff66ae3632a4cd0391c487a327ef401ca (diff)
downloadpostgresql-9937088b26eef7bbe27a9bb5f497aa6307fded5c.tar.gz
postgresql-9937088b26eef7bbe27a9bb5f497aa6307fded5c.zip
Another portability fix for tzcode2016g update.
clang points out that SIZE_MAX wouldn't fit into an int, which means this comparison is pretty useless. Per report from Thomas Munro.
Diffstat (limited to 'src')
-rw-r--r--src/timezone/zic.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 04f4df27cec..3f714ef46cb 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -424,9 +424,8 @@ growalloc(void *ptr, size_t itemsize, int nitems, int *nitems_alloc)
else
{
int nitems_max = INT_MAX - WORK_AROUND_QTBUG_53071;
- int amax = nitems_max < SIZE_MAX ? nitems_max : SIZE_MAX;
- if ((amax - 1) / 3 * 2 < *nitems_alloc)
+ if ((nitems_max - 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));