Check that QIODevice::open() is successful, and explicitly call close()
This commit is contained in:
@@ -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-------
|
||||
|
||||
Reference in New Issue
Block a user