aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/StringConvert.h
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-27 21:26:14 +0200
committerTreeston <treeston.mmoc@gmail.com>2020-08-27 21:26:14 +0200
commit7478c2c65aea853a2086c9c7ecc56c14ad6ee338 (patch)
treed25ede6a2713ae7dda10bdc59f544943c1da20b5 /src/common/Utilities/StringConvert.h
parentbe73959a0d838f71f9ff995486479fdffb7ab013 (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.h2
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;