diff --git a/src/lib/orderedjson.cpp b/src/lib/orderedjson.cpp index 07c31225..387dac6d 100644 --- a/src/lib/orderedjson.cpp +++ b/src/lib/orderedjson.cpp @@ -631,7 +631,8 @@ struct JsonParser final { if (str[i] != '.' && str[i] != 'e' && str[i] != 'E' && (i - start_pos) <= static_cast(std::numeric_limits::digits10)) { - return std::atoi(str.toStdString().c_str() + start_pos); + bool ok; + return str.mid(start_pos, i - start_pos).toInt(&ok); } // Decimal part @@ -658,7 +659,8 @@ struct JsonParser final { i++; } - return std::strtod(str.toStdString().c_str() + start_pos, nullptr); + bool ok; + return str.mid(start_pos, i - start_pos).toDouble(&ok); } /* expect(str, res)