From: Peter Stuge Date: Sun, 25 Jan 2009 20:41:51 +0000 (+0000) Subject: flashrom: Fix stupid off-by-one error in erase verification. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=commitdiff_plain;h=7e6ff8bfc0e5c9a5238f046892dc19bcbec55780 flashrom: Fix stupid off-by-one error in erase verification. As reported by Jody McIntyre. Thanks! Signed-off-by: Peter Stuge Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3894 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c index 26585fb72..4d8614a33 100644 --- a/util/flashrom/flashrom.c +++ b/util/flashrom/flashrom.c @@ -605,7 +605,7 @@ int main(int argc, char *argv[]) memcpy(buf, (const char *)flash->virtual_memory, size); else flash->read(flash, buf); - for (erasedbytes = 0; erasedbytes <= size; erasedbytes++) + for (erasedbytes = 0; erasedbytes < size; erasedbytes++) if (0xff != buf[erasedbytes]) { printf("FAILED!\n"); fprintf(stderr, "ERROR at 0x%08x: Expected=0xff, Read=0x%02x\n",