diff options
Diffstat (limited to 'src/corelib/serialization/qjsonparser.cpp')
-rw-r--r-- | src/corelib/serialization/qjsonparser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/serialization/qjsonparser.cpp b/src/corelib/serialization/qjsonparser.cpp index 6d0a92e094..d7ce702ff7 100644 --- a/src/corelib/serialization/qjsonparser.cpp +++ b/src/corelib/serialization/qjsonparser.cpp @@ -709,10 +709,11 @@ bool Parser::parseNumber() // frac = decimal-point 1*DIGIT if (json < end && *json == '.') { - isInt = false; ++json; - while (json < end && *json >= '0' && *json <= '9') + while (json < end && *json >= '0' && *json <= '9') { + isInt = isInt && *json == '0'; ++json; + } } // exp = e [ minus / plus ] 1*DIGIT @@ -893,9 +894,10 @@ bool Parser::parseString() // no escape sequences, we are done if (isUtf8) { - container->appendByteData(start, json - start - 1, QCborValue::String, - isAscii ? QtCbor::Element::StringIsAscii - : QtCbor::Element::ValueFlags {}); + if (isAscii) + container->appendAsciiString(start, json - start - 1); + else + container->appendUtf8String(start, json - start - 1); END; return true; } |