bug #43137: Writing and reading incorrect pages when using jtagicemkI

* jtagmkI.c (jtagmkI_paged_write, jtagmkI_paged_load): correctly
calculate the size of a partial (non-pagesize) buffer



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1345 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2014-11-23 20:57:17 +00:00
parent 979f010e70
commit 25829f2c5e
3 changed files with 11 additions and 4 deletions

View File

@@ -766,8 +766,8 @@ static int jtagmkI_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
return -1;
}
if ((n_bytes-addr) < page_size)
block_size = n_bytes - addr;
if (n_bytes < page_size)
block_size = n_bytes;
else
block_size = page_size;
avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_write(): "
@@ -886,8 +886,8 @@ static int jtagmkI_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
return -1;
}
if ((n_bytes-addr) < page_size)
block_size = n_bytes - addr;
if (n_bytes < page_size)
block_size = n_bytes;
else
block_size = page_size;
avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_load(): "