mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Introduce proper error handling for file streams
This commit is contained in:
parent
c38e0d05bf
commit
39fd9b93c3
23 changed files with 235 additions and 149 deletions
|
@ -392,11 +392,8 @@ bool Settings::updateConfigFile(const char *filename)
|
|||
if (!was_modified)
|
||||
return true;
|
||||
|
||||
if (!fs::safeWriteToFile(filename, os.str())) {
|
||||
errorstream << "Error writing configuration file: \""
|
||||
<< filename << "\"" << std::endl;
|
||||
if (!fs::safeWriteToFile(filename, os.str()))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue