diff --git a/include/nlohmann/detail/input/number_parse.hpp b/include/nlohmann/detail/input/number_parse.hpp index 835e623d2..4668682e9 100644 --- a/include/nlohmann/detail/input/number_parse.hpp +++ b/include/nlohmann/detail/input/number_parse.hpp @@ -986,8 +986,8 @@ void convert_float_locale_aware(StringType& token, std::size_t decimal_point_pos { std::string buffer(token.data(), token.size()); buffer.replace(decimal_point_position, 1, decimal_point); - strtof_by_type(value, buffer.c_str(), &endptr); - complete = endptr == buffer.c_str() + buffer.size(); + strtof_by_type(value, buffer.data(), &endptr); + complete = endptr == buffer.data() + buffer.size(); } if (JSON_HEDLEY_LIKELY(complete)) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 7f83650f7..bead1e45e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -10432,8 +10432,8 @@ void convert_float_locale_aware(StringType& token, std::size_t decimal_point_pos { std::string buffer(token.data(), token.size()); buffer.replace(decimal_point_position, 1, decimal_point); - strtof_by_type(value, buffer.c_str(), &endptr); - complete = endptr == buffer.c_str() + buffer.size(); + strtof_by_type(value, buffer.data(), &endptr); + complete = endptr == buffer.data() + buffer.size(); } if (JSON_HEDLEY_LIKELY(complete))