Skip to content

Commit dde26c8

Browse files
Change the CborErrorInternalError value to be non-negative
We want CborErrorOutOfMemory to be the only negative value (or at least with sign bit set), so the internal error constant can't be that. Signed-off-by: Thiago Macieira <[email protected]>
1 parent 65f7117 commit dde26c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cbor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ typedef enum CborError {
194194
CborErrorJsonNotImplemented,
195195

196196
CborErrorOutOfMemory = (int) (~0U / 2 + 1),
197-
CborErrorInternalError = (int) ~0U
197+
CborErrorInternalError = (int) (~0U / 2) /* INT_MAX on two's complement machines */
198198
} CborError;
199199

200200
CBOR_API const char *cbor_error_string(CborError error);

0 commit comments

Comments
 (0)