Skip to content

Commit 9d9bb8a

Browse files
committed
Look at first character if parse fails.
1 parent 4a4f140 commit 9d9bb8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib_json/json_reader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ bool Reader::decodeDouble(Token& token, Value& decoded) {
603603
IStringStream is(buffer);
604604
is.imbue( std::locale::classic() );
605605
if (!(is >> value)) {
606-
if (value == std::numeric_limits<double>::max())
606+
if (buffer.length() > 0 && buffer[0] != '-')
607607
value = std::numeric_limits<double>::infinity();
608-
else if (value == std::numeric_limits<double>::lowest())
608+
else if (buffer.length() > 0 && buffer[0] == '-')
609609
value = -std::numeric_limits<double>::infinity();
610610
else if (!std::isinf(value))
611611
return addError(

0 commit comments

Comments
 (0)