Fix verify size
authorGreg Davill <greg.davill@gmail.com>
Sat, 4 Dec 2021 06:05:06 +0000 (16:35 +1030)
committerGreg Davill <greg.davill@gmail.com>
Sat, 4 Dec 2021 06:05:06 +0000 (16:35 +1030)
ecpprog/ecpprog.c

index 20c3d806625003c20c1abd56a06f538dfaa54286..316000da27551e94b6b5d760afbd8d95d1cee096 100644 (file)
@@ -1125,7 +1125,7 @@ int main(int argc, char **argv)
                } else if (!erase_mode && !disable_verify) {
                        
                        flash_start_read(rw_offset);
-                       for (int addr = 0; addr < read_size; addr += 4096) {
+                       for (int addr = 0; addr < file_size; addr += 4096) {
                                uint8_t buffer_flash[4096], buffer_file[4096];
 
                                int rc = fread(buffer_file, 1, 4096, f);