Merge pull request #353 from rouault/do_from_chars_coverity_warning

do_from_chars(): initialize variable to fix Coverity Scan warning
This commit is contained in:
Pranav 2024-05-05 19:12:04 -04:00 committed by GitHub
commit eba16b3773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,7 +238,7 @@ constexpr auto consume_hex_prefix(std::string_view s)
template <class T, auto Param> template <class T, auto Param>
inline auto do_from_chars(std::string_view s) -> T { inline auto do_from_chars(std::string_view s) -> T {
T x; T x{0};
auto [first, last] = pointer_range(s); auto [first, last] = pointer_range(s);
auto [ptr, ec] = std::from_chars(first, last, x, Param); auto [ptr, ec] = std::from_chars(first, last, x, Param);
if (ec == std::errc()) { if (ec == std::errc()) {