From 4f14392880287461b2eb3f41f227f497b167ad3d Mon Sep 17 00:00:00 2001 From: Lume <141330891+Kniffler@users.noreply.github.com> Date: Wed, 10 Jun 2026 21:32:01 +0100 Subject: [PATCH] Clarify file pointer handling with comments Added comments to clarify file pointer handling in the function. --- Code/pico_multi_booter/sd_boot/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/pico_multi_booter/sd_boot/main.c b/Code/pico_multi_booter/sd_boot/main.c index 69edf02..ef67f77 100644 --- a/Code/pico_multi_booter/sd_boot/main.c +++ b/Code/pico_multi_booter/sd_boot/main.c @@ -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};