]> git.cworth.org Git - apitrace/commit
Avoid inserting 'inf' and friends into the json output.
authorCarl Worth <cworth@cworth.org>
Mon, 30 Jul 2012 22:01:15 +0000 (15:01 -0700)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 2 Aug 2012 17:26:31 +0000 (18:26 +0100)
commit112e747d935404ebbea2225b076cc5fd6db636f7
treee8ddad5faa1c88d4627b902219dbad8f0822789e
parent63c9adf7464d93eec49c2f54590d117f0c0b79bc
Avoid inserting 'inf' and friends into the json output.

The JSON-generating code was previously carefult to avoid emitting NaN
into its output, but it would still write "inf" for an infinite value,
(which is invalid JSON).

Fix by calling writeNull for any value for which std::isfinite returns
false, (rather than the previous test for merely (n != n)).
retrace/json.hpp