Use data() instead of c_str() in the multi-byte decimal point path

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann authored and GitHub committed 2026-10-13 22:22:20 +02:00
1 parent a9b0e6b843
commit af711143a0
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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))