From 0b5c79ab9adf9b7f7e1bef9e9f6bd6be2bb3154e Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 13 Sep 2013 12:48:13 +0000 Subject: [PATCH] Fix counting pages for the non-verify read case. Previously, yielded 0, resulting in a division by 0 in report_progress(). git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1221 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/avr.c b/avr.c index da4d3e9a..9e3598f7 100644 --- a/avr.c +++ b/avr.c @@ -383,7 +383,11 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, for (i = pageaddr; i < pageaddr + mem->page_size; i++) - if ((mem->tags[i] & TAG_ALLOCATED) != 0) { + if (vmem == NULL /* no verify, read everything */ || + (mem->tags[i] & TAG_ALLOCATED) != 0 /* verify, do only + read pages that + are needed in + input file */) { npages++; break; }