Open wridgers opened 1 month ago
Positive integers are read as uint
type, and negative integers are read as sint
type. So is_sint(uint_val)
returns false.
I recommend using yyjson_is_int(val)
instead, which returns true for both uint and sint types.
Describe the bug
yyjson_is_sint()
returns false for positive integersYour environment
Additional context I assume this is related to https://github.com/ibireme/yyjson/issues/152.
I wrote a few quick tests:
The
123
variant fails, while the-123
variant passes.