Browse Source

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.
tags/json-c-0.15-20200726
Eric Haszlakiewicz 5 years ago
parent
commit
6465e74020
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      json_object.c

+ 3
- 3
json_object.c View File

@@ -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


Loading…
Cancel
Save