Add forgotten fclose calls

This commit is contained in:
wheremyfoodat 2023-08-17 15:14:05 +03:00
parent 7e0f0cc99a
commit b1b430f92b
2 changed files with 3 additions and 0 deletions

View file

@ -19,11 +19,13 @@ HorizonResult SaveDataArchive::createFile(const FSPath& path, u64 size) {
// If the size is 0, leave the file empty and return success
if (size == 0) {
file.close();
return Result::Success;
}
// If it is not empty, seek to size - 1 and write a 0 to create a file of size "size"
else if (file.seek(size - 1, SEEK_SET) && file.writeBytes("", 1).second == 1) {
file.close();
return Result::Success;
}