Bugfix: check if file exists before overwrite

This commit is contained in:
Luca D'Amico 2021-04-12 00:34:58 +02:00
parent 319d0e232e
commit 30425b6bb8
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#ifndef REVISION_H
#define REVISION_H
#define GIT_COMMIT_HASH "0b9b628"
#define GIT_COMMIT_HASH "319d0e2"
#endif

View File

@ -1,5 +1,6 @@
#include <QDir>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include "./../../mainwindow.h"
#include "./../../ui_mainwindow.h"
@ -311,6 +312,8 @@ bool MainWindow::writeEverything(const std::string& savePath)
else
paddingType = static_cast<char>('\xff');
std::remove(savePath.c_str());
res &= writeHeader(savePath);
res &= writeHeaderPadding(paddingType, savePath);
res &= writeArm9Bin(savePath, isArm9FooterPresent);