From af991085ca83b1556e13777fb3040d737fb977b3 Mon Sep 17 00:00:00 2001 From: Rene Liebscher Date: Thu, 19 Jan 2012 20:06:52 +0000 Subject: [PATCH] * avr.c: Unsigned variable was used for return code of paged_write/load functions. So a negative return code led never to a fallback to byte functions. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@1042 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 6 ++++++ avrdude/avr.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 7e748b1a..7e00cbc7 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,9 @@ +2012-01-19 Rene Liebscher + + * avr.c: Unsigned variable was used for return code of paged_write/load + functions. So a negative return code led never to a fallback to byte + functions. + 2012-01-17 Rene Liebscher bug #34302: Feature request : device configuration with parent classes diff --git a/avrdude/avr.c b/avrdude/avr.c index bdacf28f..a7a74769 100644 --- a/avrdude/avr.c +++ b/avrdude/avr.c @@ -289,9 +289,9 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, break; } if (need_read) { - i = pgm->paged_load(pgm, p, mem, mem->page_size, + rc = pgm->paged_load(pgm, p, mem, mem->page_size, pageaddr, mem->page_size); - if (i < 0) + if (rc < 0) /* paged load failed, fall back to byte-at-a-time read below */ failure = 1; } else if (verbose >= 3) { @@ -807,8 +807,8 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, break; } if (need_write) { - i = pgm->paged_write(pgm, p, m, m->page_size, pageaddr, m->page_size); - if (i < 0) + rc = pgm->paged_write(pgm, p, m, m->page_size, pageaddr, m->page_size); + if (rc < 0) /* paged write failed, fall back to byte-at-a-time write below */ failure = 1; } else if (verbose >= 3) {