diff --git a/Core/GameEngine/Source/Common/INI/INI.cpp b/Core/GameEngine/Source/Common/INI/INI.cpp index a59d2b0b6fc..dfcfdb6e8c7 100644 --- a/Core/GameEngine/Source/Common/INI/INI.cpp +++ b/Core/GameEngine/Source/Common/INI/INI.cpp @@ -1618,8 +1618,16 @@ void INI::initFromINIMulti( void *what, const MultiIniFieldParse& parseTableList template Type scanType(std::string_view token) { - // TheSuperHackers @info std::from_chars cannot parse "-1" as uint32 so the result needs to be int64 for integers. - std::conditional_t, Int64, Real> result{}; + DEBUG_ASSERTCRASH(!token.empty(), ("token is not expected to be empty")); + + // Unlike sscanf, std::from_chars cannot parse "+" + if (token[0] == '+') + { + token.remove_prefix(1); + } + + // Unlike sscanf, std::from_chars cannot parse "-" as unsigned integer + std::conditional_t, Int64, Type> result{}; const auto [ptr, ec] = std::from_chars(token.data(), token.data() + token.size(), result); if (ec != std::errc{})