We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dd4b28 commit 95368deCopy full SHA for 95368de
system/ymodem/ymodem.c
@@ -307,24 +307,25 @@ static int ymodem_recv_file(FAR struct ymodem_ctx_s *ctx)
307
308
static int ymodem_recv_cmd(FAR struct ymodem_ctx_s *ctx, uint8_t cmd)
309
{
310
+ uint8_t recv;
311
int ret;
312
- ret = ymodem_recv_buffer(ctx, ctx->header, 1);
313
+ ret = ymodem_recv_buffer(ctx, &recv, 1);
314
if (ret < 0)
315
316
ymodem_debug("recv cmd error\n");
317
return ret;
318
}
319
- if (ctx->header[0] == NAK)
320
+ if (recv == NAK)
321
322
return -EAGAIN;
323
324
- if (ctx->header[0] != cmd)
325
+ if (recv != cmd)
326
327
ymodem_debug("recv cmd error, must 0x%x, but receive 0x%x\n",
- cmd, ctx->header[0]);
328
+ cmd, recv);
329
return -EINVAL;
330
331
0 commit comments