From 6465e74020fd5418043a4b23ffdc2011e34f0c7a Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Wed, 1 Jul 2020 00:34:46 +0000 Subject: [PATCH] Use constants referring to the signed integer types when setting SSIZE_T_MAX. In practice, the sizes of the signed and unsigned integer types will almost cetainly be the same, but this is more correct. Pointed out in issue #638. --- json_object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/json_object.c b/json_object.c index 1dffd00..73daa4c 100644 --- a/json_object.c +++ b/json_object.c @@ -41,11 +41,11 @@ #ifndef SSIZE_T_MAX #if SIZEOF_SSIZE_T == SIZEOF_INT -#define SSIZE_T_MAX UINT_MAX +#define SSIZE_T_MAX INT_MAX #elif SIZEOF_SSIZE_T == SIZEOF_LONG -#define SSIZE_T_MAX ULONG_MAX +#define SSIZE_T_MAX LONG_MAX #elif SIZEOF_SSIZE_T == SIZEOF_LONG_LONG -#define SSIZE_T_MAX ULLONG_MAX +#define SSIZE_T_MAX LLONG_MAX #else #error Unable to determine size of ssize_t #endif