Prevent slot0x??key?.bin file locks

.. actually close the file after key is found
This commit is contained in:
d0k3 2016-12-26 16:01:57 +01:00
parent f05e77a99f
commit 73eff94484

View File

@ -202,10 +202,8 @@ u32 LoadKeyFromFile(u8* key, u32 keyslot, char type, char* id)
snprintf(path, 64, "%s/slot0x%02lXKey%s.bin", base[i], keyslot,
(id) ? id : (type == 'X') ? "X" : (type == 'Y') ? "Y" : "");
if (f_open(&fp, path, FA_READ | FA_OPEN_EXISTING) != FR_OK) continue;
if ((f_read(&fp, key, 16, &btr) == FR_OK) && (btr == 16)) {
if ((f_read(&fp, key, 16, &btr) == FR_OK) && (btr == 16))
found = true;
break;
}
f_close(&fp);
}
}