diff options
| author | Meco Man <[email protected]> | 2022-01-15 23:20:45 -0500 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2022-01-18 01:34:55 +0800 |
| commit | 169fca84f7799bb3fa2475978f4f97ca9dd35bb4 (patch) | |
| tree | 70bc0e4d5ef2d03c9aee5f9ad1ec88533e8c236e | |
| parent | c3162f373fbd6bacae946f717f41e271ffbe0835 (diff) | |
[ymodem] silent warnings
| -rw-r--r-- | components/utilities/ymodem/ry_sy.c | 7 | ||||
| -rw-r--r-- | components/utilities/ymodem/ymodem.h | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index b77bd7abc2..d61b0cde58 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -15,8 +15,6 @@ #include <unistd.h> #include <sys/stat.h> #include <sys/statfs.h> - -#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -115,7 +113,7 @@ static enum rym_code _rym_send_begin( rt_kprintf("error open file.\n"); return RYM_ERR_FILE; } - sprintf((char *)buf, "%s%c%ld", (char *) & (cctx->fpath[1]), insert_0, file_buf.st_size); + rt_sprintf((char *)buf, "%s%c%d", (char *) & (cctx->fpath[1]), insert_0, file_buf.st_size); return RYM_CODE_SOH; } @@ -140,8 +138,7 @@ static enum rym_code _rym_send_data( if (read_size < len) { rt_memset(buf + read_size, 0x1A, len - read_size); - /* stage = RYM_STAGE_FINISHING */ - ctx->stage = 4; + ctx->stage = RYM_STAGE_FINISHING; } return RYM_CODE_SOH; diff --git a/components/utilities/ymodem/ymodem.h b/components/utilities/ymodem/ymodem.h index 7006cf268d..2f05e4f2f2 100644 --- a/components/utilities/ymodem/ymodem.h +++ b/components/utilities/ymodem/ymodem.h @@ -72,7 +72,7 @@ enum rym_code enum rym_stage { - RYM_STAGE_NONE, + RYM_STAGE_NONE = 0, /* set when C is send */ RYM_STAGE_ESTABLISHING, /* set when we've got the packet 0 and sent ACK and second C */ |
