aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/numutils.c')
-rw-r--r--src/backend/utils/adt/numutils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c
index a2ba7fcafe6..a64422c8d06 100644
--- a/src/backend/utils/adt/numutils.c
+++ b/src/backend/utils/adt/numutils.c
@@ -122,7 +122,7 @@ pg_strtoint16(const char *s)
/* process digits */
while (*ptr && isdigit((unsigned char) *ptr))
{
- if (unlikely(tmp > (PG_INT16_MAX / 10)))
+ if (unlikely(tmp > -(PG_INT16_MIN / 10)))
goto out_of_range;
tmp = tmp * 10 + (*ptr++ - '0');
@@ -200,7 +200,7 @@ pg_strtoint32(const char *s)
/* process digits */
while (*ptr && isdigit((unsigned char) *ptr))
{
- if (unlikely(tmp > (PG_INT32_MAX / 10)))
+ if (unlikely(tmp > -(PG_INT32_MIN / 10)))
goto out_of_range;
tmp = tmp * 10 + (*ptr++ - '0');
@@ -278,7 +278,7 @@ pg_strtoint64(const char *s)
/* process digits */
while (*ptr && isdigit((unsigned char) *ptr))
{
- if (unlikely(tmp > (PG_INT64_MAX / 10)))
+ if (unlikely(tmp > -(PG_INT64_MIN / 10)))
goto out_of_range;
tmp = tmp * 10 + (*ptr++ - '0');