Skip to content

Commit

Permalink
Restore shortname-backup.bin, not backup.bin
Browse files Browse the repository at this point in the history
  • Loading branch information
angelsl committed Jan 14, 2018
1 parent a6dad03 commit 93f60c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ void ntrboot_restore_flash() {
DrawString(TOP_SCREEN, 10, 20, STD_COLOR_FONT, STD_COLOR_BG, "Restoring flash");

uint8_t *flash_mem = NULL, *mem = NULL;
FILE *const f = fopen("fat1:/ntrboot/backup.bin","rb");
const char *const backuppath = backup_path(selected_flashcart->getShortName());
FILE *const f = fopen(backuppath, "rb");

if (!f) {
DrawString(TOP_SCREEN, 10, 40, COLOR_RED, STD_COLOR_BG, "Restore file was not found.");
Expand Down Expand Up @@ -239,6 +240,7 @@ void ntrboot_restore_flash() {
fclose(f);
}

free(backuppath);
DrawString(TOP_SCREEN, 10, 160, STD_COLOR_FONT, STD_COLOR_BG, "Press <A> to return to the main menu.");
WaitButton(BUTTON_A);
}
Expand Down

0 comments on commit 93f60c5

Please sign in to comment.