mirror of
https://github.com/flightlessmango/MangoHud.git
synced 2024-10-31 15:20:13 +00:00
read_line: return empty line if ifstream fails
This commit is contained in:
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…
Reference in New Issue
Block a user