Merge pull request #8565 from eightycc/fakembr

Fix off-by-one in flash block read with fake MBR
This commit is contained in:
Dan Halbert 2023-11-06 12:55:42 -05:00 committed by GitHub
commit 217b894057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -105,6 +105,7 @@ static mp_uint_t flash_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t n
if (num_blocks > 1) { if (num_blocks > 1) {
dest += 512; dest += 512;
num_blocks -= 1; num_blocks -= 1;
block_num += 1;
// Fall through and do a read from flash. // Fall through and do a read from flash.
} else { } else {
return 0; // Done and ok. return 0; // Done and ok.