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
This commit is contained in:
Joerg Wunsch 2013-09-13 12:48:13 +00:00
parent 9697ebe2ec
commit 0b5c79ab9a
1 changed files with 5 additions and 1 deletions

6
avr.c
View File

@ -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;
}