Fix a bug introduced in rev. 1.69, when implementing the

fallback from each programmer's paged_load() or paged_write()
method, respectively.  The return value needs to be checked for
being greater or equal than 0 rather equal to 0 in order to
assume the operation has been successful.

Fixes bug #18489: avrdude is too slow (20 byte/s)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@695 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2006-12-11 14:01:54 +00:00
parent 7e20e7571f
commit 76e7613841
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de>
* avr.c: Fix a bug introduced in rev. 1.69, when implementing the
fallback from each programmer's paged_load() or paged_write()
method, respectively. The return value needs to be checked for
being greater or equal than 0 rather equal to 0 in order to
assume the operation has been successful.
Fixes bug #18489: avrdude is too slow (20 byte/s)
2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de> 2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de>
* avr910.c: Make the code compile warning-free: * avr910.c: Make the code compile warning-free:

4
avr.c
View File

@ -183,7 +183,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
* instead * instead
*/ */
rc = pgm->paged_load(pgm, p, mem, mem->page_size, size); rc = pgm->paged_load(pgm, p, mem, mem->page_size, size);
if (rc == 0) { if (rc >= 0) {
if (strcasecmp(mem->desc, "flash") == 0) if (strcasecmp(mem->desc, "flash") == 0)
return avr_mem_hiaddr(mem); return avr_mem_hiaddr(mem);
else else
@ -579,7 +579,7 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
* efficiently than we can read it directly, so use its routine * efficiently than we can read it directly, so use its routine
* instead * instead
*/ */
if (pgm->paged_write(pgm, p, m, m->page_size, size) == 0) if (pgm->paged_write(pgm, p, m, m->page_size, size) >= 0)
return 0; return 0;
} }
} }