diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-08-27 21:26:14 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-04 00:27:14 +0100 |
commit | 6e45c371c4098942e0085a71577a07b17725ee93 (patch) | |
tree | 35f665a45127fc6352306562f8019a39c05199d2 /src | |
parent | 2154251ac74bbcb8d780feffea427f47425b62e1 (diff) |
Common/Utilities: Properly read std::from_chars documentation and check for out_of_range errors.
(cherry picked from commit 7478c2c65aea853a2086c9c7ecc56c14ad6ee338)
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Utilities/StringConvert.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/Utilities/StringConvert.h b/src/common/Utilities/StringConvert.h index f90e47cab10..fbdc41f6aef 100644 --- a/src/common/Utilities/StringConvert.h +++ b/src/common/Utilities/StringConvert.h @@ -69,7 +69,7 @@ namespace Trinity::Impl::StringConvertImpl T val; std::from_chars_result const res = std::from_chars(start, end, val, base); - if (res.ptr == end) + if ((res.ptr == end) && (res.ec == std::errc())) return val; else return std::nullopt; |