diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-08-27 21:26:14 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2020-08-27 21:26:14 +0200 |
commit | 7478c2c65aea853a2086c9c7ecc56c14ad6ee338 (patch) | |
tree | d25ede6a2713ae7dda10bdc59f544943c1da20b5 /src/common/Utilities/StringConvert.h | |
parent | be73959a0d838f71f9ff995486479fdffb7ab013 (diff) |
Common/Utilities: Properly read std::from_chars documentation and check for out_of_range errors.
Diffstat (limited to 'src/common/Utilities/StringConvert.h')
-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; |