fix exception with std::stoi

pull/1296/head
Etaash Mathamsetty 3 weeks ago committed by flightlessmango
parent 1e13c385fe
commit 5912cce19f

@ -469,7 +469,8 @@ static bool find_input(const std::string& path, const char* input_prefix, std::s
if (uscore != std::string::npos) {
file.erase(uscore, std::string::npos);
input = path + "/" + file + "_input";
return std::stoi(read_line(input)) > 0;
//9 characters should not overflow the 32-bit int
return std::stoi(read_line(input).substr(0, 9)) > 0;
}
}
return false;

Loading…
Cancel
Save