This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 715da6bde system/ymodem: fix send err when partial write
715da6bde is described below
commit 715da6bde6e4e6f4176f29a27aecc5d065514dcf
Author: fangpeina <[email protected]>
AuthorDate: Thu Dec 25 01:04:40 2025 +0800
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 <[email protected]>
---
system/ymodem/ymodem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/ymodem/ymodem.c b/system/ymodem/ymodem.c
index 79c131f37..354f09962 100644
--- a/system/ymodem/ymodem.c
+++ b/system/ymodem/ymodem.c
@@ -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);