mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
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:
commit
eba16b3773
@ -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()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user