From: Eric Haszlakiewicz Date: Wed, 1 Jul 2020 00:34:46 +0000 (+0000) Subject: Use constants referring to the signed integer types when setting SSIZE_T_MAX. X-Git-Tag: json-c-0.15-20200726~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6465e74020fd5418043a4b23ffdc2011e34f0c7a;p=thirdparty%2Fjson-c.git 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. --- diff --git a/json_object.c b/json_object.c index 1dffd005..73daa4c8 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