mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
system/ymodem: fix send err when partial write
Fix buffer offset calculation in ymodem_send_buffer() to correctly handle partial writes by advancing the buffer pointer and adjusting the remaining size on each retry. Signed-off-by: fangpeina <fangpeina@xiaomi.com>
This commit is contained in:
parent
19dcc896d7
commit
715da6bde6
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ static int ymodem_send_buffer(FAR struct ymodem_ctx_s *ctx,
|
|||
ymodem_debug("send buffer data, write size is %zu\n", size);
|
||||
while (i < size)
|
||||
{
|
||||
ssize_t ret = write(ctx->sendfd, buf, size);
|
||||
ssize_t ret = write(ctx->sendfd, buf + i, size - i);
|
||||
if (ret >= 0)
|
||||
{
|
||||
ymodem_debug("send buffer data, size %zd\n", ret);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue