From a0595f17e8c33301a6b12f2217d3ab643e13c18b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 20 Dec 2016 13:13:50 +0200 Subject: [PATCH] Serializer now writes floating point zero if special value is encountered See https://forum.zdoom.org/viewtopic.php?t=54592 --- src/rapidjson/writer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rapidjson/writer.h b/src/rapidjson/writer.h index a288f07ff..200abadae 100644 --- a/src/rapidjson/writer.h +++ b/src/rapidjson/writer.h @@ -527,7 +527,9 @@ inline bool Writer::WriteDouble(double d) { if (!(kWriteDefaultFlags & kWriteNanAndInfFlag)) { // At least ensure that the output does not get broken. - PutReserve(*os_, 1); + PutReserve(*os_, 3); + PutUnsafe(*os_, '0'); + PutUnsafe(*os_, '.'); PutUnsafe(*os_, '0'); return false; }