diff --git a/src/numberparsing.h b/src/numberparsing.h index 374b2d1..ee61d67 100644 --- a/src/numberparsing.h +++ b/src/numberparsing.h @@ -65,7 +65,7 @@ template<> inline tl::expected fromString(std:: template<> inline tl::expected fromString(std::string_view str) { int val; - if (std::sscanf(str.data(), "%" SCNi32, &val) != 1) + if (std::sscanf(str.data(), "%i", &val) != 1) return tl::make_unexpected(fmt::format("invalid int {}", str)); return val; } @@ -73,7 +73,7 @@ template<> inline tl::expected fromString(std::string_vie template<> inline tl::expected fromString(std::string_view str) { unsigned int val; - if (std::sscanf(str.data(), "%" SCNu32, &val) != 1) + if (std::sscanf(str.data(), "%u", &val) != 1) return tl::make_unexpected(fmt::format("invalid unsigned int {}", str)); return val; }