In jtagmkII_paged_write(), default the pages size to 256 early enough
so the buffer will then be allocated correctly. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@532 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
1ce76bfc60
commit
8e5b230e47
|
@ -1165,6 +1165,8 @@ static int jtagmkII_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
if (jtagmkII_program_enable(pgm) < 0)
|
||||
return -1;
|
||||
|
||||
if (page_size == 0) page_size = 256;
|
||||
|
||||
if ((cmd = malloc(page_size + 10)) == NULL) {
|
||||
fprintf(stderr, "%s: jtagmkII_paged_write(): Out of memory\n",
|
||||
progname);
|
||||
|
@ -1182,8 +1184,6 @@ static int jtagmkII_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
page_size = eeprom_pagesize;
|
||||
}
|
||||
|
||||
if (page_size == 0) page_size = 256;
|
||||
|
||||
serial_recv_timeout = 100;
|
||||
for (addr = 0; addr < n_bytes; addr += page_size) {
|
||||
report_progress(addr, n_bytes,NULL);
|
||||
|
|
Loading…
Reference in New Issue