diff --git a/toml/parser.hpp b/toml/parser.hpp index da4b551..fb6cb5c 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -68,7 +68,8 @@ parse_binary_integer(location& loc) assert(str.empty() || str.front() == '1'); // since toml11 uses int64_t, 64bit (unsigned) input cannot be read. - if(64 + std::count(str.begin(), str.end(), '_') <= str.size()) + const auto max_length = 63 + std::count(str.begin(), str.end(), '_'); + if(static_cast(max_length) < str.size()) { loc.reset(first); return err(format_underline("toml::parse_binary_integer: "