Merge pull request #126 from fsugai/master

Fix: FOE_fwrite is unable to detect a failure if write_function fails to write on last data
pull/133/head
nakarlsson 2022-08-19 15:56:45 +02:00 committed by GitHub
commit 8de160a851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;