Clarify file pointer handling with comments

Added comments to clarify file pointer handling in the function.
This commit is contained in:
Lume
2026-06-10 21:32:01 +01:00
committed by GitHub
parent bcefe717c7
commit 4f14392880

View File

@@ -171,6 +171,9 @@ static bool __not_in_flash_func(load_program)(const char *filename)
fclose(fp);
return true;
}
// We need to set the pointer back because is_same_existing_program will move the file pointer (fp)
// whether we like it or not.
fseek(fp, 0, SEEK_SET);
size_t program_size = 0;
uint8_t buffer[FLASH_SECTOR_SIZE] = {0};