Do not increment ncopied if failed writing

pull/126/head
Fumihito Sugai 2022-08-19 19:11:39 +09:00
parent fc72fbeeec
commit 35288ff3e7
1 changed files with 8 additions and 1 deletions

View File

@ -162,7 +162,14 @@ static uint16_t FOE_fwrite (uint8_t *data, uint16_t length)
foe_file->address_offset += foe_cfg->buffer_size;
}
FOEvar.fposition++;
ncopied++;
if(failed)
{
DPRINT("Failed FOE_fwrite ncopied=%d\n", ncopied);
}
else
{
ncopied++;
}
}
foe_file->total_size += ncopied;