ibireme / yyjson

The fastest JSON library in C
https://ibireme.github.io/yyjson/doc/doxygen/html/
MIT License
3.04k stars 262 forks source link

YYJSON_WRITE_ALLOW_INF_AND_NAN is not disabled when YYJSON_DISABLE_NON_STANDARD is active #80

Closed pavelxdd closed 2 years ago

pavelxdd commented 2 years ago

As mentioned in #79, yyjson_val_write_opts and yyjson_mut_val_write_opts should include


#if YYJSON_DISABLE_NON_STANDARD
    flg &= ~YYJSON_WRITE_ALLOW_INF_AND_NAN;
#endif

like it is done in reader functions.

Currenly just adding this block is not enough, the tests don't check the YYJSON_DISABLE_NON_STANDARD before testing writer with YYJSON_WRITE_ALLOW_INF_AND_NAN flag.

ibireme commented 2 years ago

Fixed.