From: Will Sowerbutts Date: Mon, 9 Jan 2017 02:13:06 +0000 (+0000) Subject: flashrom: Bugfix for off-by-one error with --partial X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8fb6fd689dc7b61dc10e559702af256a3d99c464;p=FUZIX.git flashrom: Bugfix for off-by-one error with --partial --- diff --git a/Applications/flashrom/flashrom.c b/Applications/flashrom/flashrom.c index 75b5392c..fc73746f 100644 --- a/Applications/flashrom/flashrom.c +++ b/Applications/flashrom/flashrom.c @@ -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);