We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, could you add a support of writing Inf and NaN values as null, maybe via a writer flag?
Currently a apply this patch for yyjson in my project to achieve this:
diff --git a/src/yyjson.c b/src/yyjson.c index 6a571b5..dc973a3 100644 --- a/src/yyjson.c +++ b/src/yyjson.c @@ -5635,7 +5635,8 @@ static_noinline u8 *write_f64_raw(u8 *buf, u64 raw, bool allow_nan_and_inf) { return buf + 3; } } else { - return NULL; + *(v32 *)&buf[0] = v32_make('n', 'u', 'l', 'l'); + return buf + 4; } } @@ -5779,7 +5780,8 @@ static_noinline u8 *write_f64_raw(u8 *buf, u64 raw, bool allow_nan_and_inf) { return buf + 3; } } else { - return NULL; + *(v32 *)&buf[0] = v32_make('n', 'u', 'l', 'l'); + return buf + 4; } } }
The text was updated successfully, but these errors were encountered:
This feature is really necessary. Added to the master branch, try this flag: YYJSON_WRITE_INF_AND_NAN_AS_NULL.
YYJSON_WRITE_INF_AND_NAN_AS_NULL
Sorry, something went wrong.
No branches or pull requests
Hello, could you add a support of writing Inf and NaN values as null, maybe via a writer flag?
Currently a apply this patch for yyjson in my project to achieve this:
The text was updated successfully, but these errors were encountered: