]> granicus.if.org Git - json-c/commitdiff
Use constants referring to the signed integer types when setting SSIZE_T_MAX.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Wed, 1 Jul 2020 00:34:46 +0000 (00:34 +0000)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Wed, 1 Jul 2020 00:34:46 +0000 (00:34 +0000)
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

index 1dffd005d6596ca0c3dca3a4b831b418e9376864..73daa4c8c5305bb376675acb8072cfc524330890 100644 (file)
 
 #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