Fix error detection for reading a page to pad unset bytes

This commit is contained in:
Stefan Rueger 2022-11-24 12:16:43 +00:00
parent 68c6ffd7fc
commit 8e79b7dc52
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 1 additions and 1 deletions

View File

@ -960,7 +960,7 @@ int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int
continue;
// Read flash contents to separate memory spc and fill in holes
if(avr_read_page_default(pgm, p, cm, beg, spc) == 0) {
if(avr_read_page_default(pgm, p, cm, beg, spc) >= 0) {
pmsg_notice2("padding %s [0x%04x, 0x%04x]\n", cm->desc, beg, end-1);
for(i = beg; i < end; i++)
if(!(cm->tags[i] & TAG_ALLOCATED)) {