Skip to content

Commit

Permalink
Support different compile-time options: #170
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Jun 30, 2024
1 parent 7b47463 commit 699edbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/yyjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -5072,7 +5072,7 @@ static_inline bool read_number(u8 **ptr,
bool sign;

/* read number as raw string if has `YYJSON_READ_NUMBER_AS_RAW` flag */
if (unlikely(pre && !has_read_flag(BIGNUM_AS_RAW))) {
if (has_read_flag(NUMBER_AS_RAW)) {
return read_number_raw(ptr, pre, flg, val, msg);
}

Expand Down
2 changes: 2 additions & 0 deletions test/test_number.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,9 @@ static void test_bignum(void) {
yyjson_read_flag flag_arr[] = {
YYJSON_READ_NUMBER_AS_RAW,
YYJSON_READ_BIGNUM_AS_RAW,
#if !YYJSON_DISABLE_NON_STANDARD
YYJSON_READ_ALLOW_INF_AND_NAN,
#endif
};

for (usize i = 0; i < yy_nelems(num_arr); i++) {
Expand Down

0 comments on commit 699edbf

Please sign in to comment.