mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
fix(JSON::Stringifier): JSON Serializing NAN #3251
This commit is contained in:
@@ -62,6 +62,8 @@ void Stringifier::stringify(const Var& any, std::ostream& out, unsigned int inde
|
||||
else if (any.isNumeric() || any.isBoolean())
|
||||
{
|
||||
std::string value = any.convert<std::string>();
|
||||
if ((Poco::icompare(value, "nan") == 0) ||
|
||||
(Poco::icompare(value, "inf") == 0)) value = "null";
|
||||
if (any.type() == typeid(char)) formatString(value, out, options);
|
||||
else out << value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user