flashrom: Bugfix for off-by-one error with --partial
authorWill Sowerbutts <will@sowerbutts.com>
Mon, 9 Jan 2017 02:13:06 +0000 (02:13 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Mon, 9 Jan 2017 02:13:27 +0000 (02:13 +0000)
Applications/flashrom/flashrom.c

index 75b5392..fc73746 100644 (file)
@@ -332,7 +332,7 @@ bool flashrom_verify_and_write(bool perform_write)
         rom_address = flashrom_sector_address(sector);
 
         /* check for EOF */
-        if(rom_address > file_size)
+        if(rom_address >= file_size)
             break;
 
         /* verify sector */
@@ -380,7 +380,7 @@ bool flashrom_verify_and_write(bool perform_write)
         printf("\rWrite complete: Reprogrammed %d/%d sectors.\n", mismatch, flashrom_type->sector_count);
     }else{
         if(sector != flashrom_type->sector_count)
-            printf("\rPartial verify (%d/%d sectors)", sector-1, flashrom_type->sector_count);
+            printf("\rPartial verify (%d/%d sectors)", sector, flashrom_type->sector_count);
         else
             printf("\rVerify (%d sectors)", flashrom_type->sector_count);