Merge pull request #403 from rafaelvcaetano/fix-firmware-fopen

Firmware backup writing now uses OpenLocalFile
This commit is contained in:
Arisotura 2019-05-17 14:55:44 +02:00 committed by GitHub
commit 63e42bf90f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -130,11 +130,11 @@ void Reset()
// take a backup
const char* firmbkp = "firmware.bin.bak";
f = fopen(firmbkp, "rb");
f = Platform::OpenLocalFile(firmbkp, "rb");
if (f) fclose(f);
else
{
f = fopen(firmbkp, "wb");
f = Platform::OpenLocalFile(firmbkp, "wb");
fwrite(Firmware, 1, FirmwareLength, f);
fclose(f);
}