Check that QIODevice::open() is successful, and explicitly call close()

This commit is contained in:
Jonas Kvinge
2021-07-14 20:52:57 +02:00
parent f64c1dd9e5
commit 2eab763d74
15 changed files with 74 additions and 49 deletions

View File

@@ -222,7 +222,9 @@ int main(int argc, char *argv[]) {
// Create the file if it doesn't exist already
if (!QFile::exists(s.fileName())) {
QFile file(s.fileName());
file.open(QIODevice::WriteOnly);
if (file.open(QIODevice::WriteOnly)) {
file.close();
}
}
// Set -rw-------