read_line: return empty line if ifstream fails
@@ -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;
}
