jv_parse: let decNumberFromString/strtod parse complex nans as a NaN
Before this patch (when using decNumber), "Nan123" was parsed as a NaN, only if the first n was uppercase.
This commit is contained in:
1 parent
dcf9a8e580
commit
c5fd64ba97
2 files changed
+6
-1
No files matched your search
+1
-1
@@ -514,7 +514,7 @@ static pfunc check_literal(struct jv_parser* p) {
|
||||
case 'f': pattern = "false"; plen = 5; v = jv_false(); break;
|
||||
case 'n':
|
||||
// if it starts with 'n', it could be a literal "nan"
|
||||
if (p->tokenpos != 3) {
|
||||
if (p->tokenbuf[1] == 'u') {
|
||||
pattern = "null"; plen = 4; v = jv_null();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user