Commit 7a1ec75ee1010942c873258fb7a786e677dee9df
1 parent
2856b288
Fix writing reals with trailing '.' as JSON (fixes #1261)
Showing
3 changed files
with
9 additions
and
0 deletions
ChangeLog
libqpdf/QPDF_Real.cc
libtests/json.cc
| ... | ... | @@ -111,6 +111,7 @@ test_main() |
| 111 | 111 | check(QPDFObjectHandle::newReal(".34").getJSON(i), "0.34"); |
| 112 | 112 | check(QPDFObjectHandle::newReal("-0.56").getJSON(i), "-0.56"); |
| 113 | 113 | check(QPDFObjectHandle::newReal("-.78").getJSON(i), "-0.78"); |
| 114 | + check(QPDFObjectHandle::newReal("-78.").getJSON(i), "-78.0"); | |
| 114 | 115 | } |
| 115 | 116 | JSON jmap2 = JSON::parse(R"({"a": 1, "b": "two", "c": [true]})"); |
| 116 | 117 | std::map<std::string, std::string> dvalue; | ... | ... |