From 2822ec377d8c1b8259c42034fe60c9edc6674bbb Mon Sep 17 00:00:00 2001 From: Chinese66 <1032921868@qq.com> Date: Wed, 11 Mar 2020 11:56:35 +0800 Subject: [PATCH] Update ry_sy.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了读取不到文件大小,导致的文件传输的问题,问题说明在 https://www.rt-thread.org/qa/forum.php?mod=viewthread&tid=423781 --- components/utilities/ymodem/ry_sy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index 4f4476e402..a87f6949db 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -40,7 +40,7 @@ static enum rym_code _rym_recv_begin( rt_kprintf("error creating file: %d\n", err); return RYM_CODE_CAN; } - cctx->flen = atoi((const char *)buf + rt_strnlen((const char *)buf, len - 1)); + cctx->flen = atoi(1 + (const char *)buf + rt_strnlen((const char *)buf, len - 1)); if (cctx->flen == 0) cctx->flen = -1;