read_line: return empty line if ifstream fails

pull/657/head
FlightlessMango 3 years ago
parent ac58c30bbc
commit 52ae70f650

@ -14,6 +14,9 @@ std::string read_line(const std::string& filename)
{
std::string line;
std::ifstream file(filename);
if (file.fail()){
return line;
}
std::getline(file, line);
return line;
}

Loading…
Cancel
Save