From ebaf6821517af4de95b39c9398c8f77610ccc28f Mon Sep 17 00:00:00 2001 From: Jaro Date: Sun, 12 Sep 2021 00:11:13 +0200 Subject: [PATCH] length --- Ymodem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Ymodem.cpp b/Ymodem.cpp index 742f51e..e771f0d 100644 --- a/Ymodem.cpp +++ b/Ymodem.cpp @@ -268,7 +268,7 @@ Ymodem::Code Ymodem::receivePacket() BOOST_LOG_TRIVIAL(debug) << "RX = " << int(rxBuffer[0]); if(rxBuffer[0] == CodeSoh) { - uint32_t len = read(&(rxBuffer[1]), YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 1); + int32_t len = read(&(rxBuffer[1]), YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 1); BOOST_LOG_TRIVIAL(debug) << "Len = " << len << " Start = " << rxBuffer[1]; @@ -286,7 +286,7 @@ Ymodem::Code Ymodem::receivePacket() } else if(rxBuffer[0] == CodeStx) { - uint32_t len = read(&(rxBuffer[1]), YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - 1); + int32_t len = read(&(rxBuffer[1]), YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - 1); if(len < (YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - 1)) { @@ -315,7 +315,7 @@ Ymodem::Code Ymodem::receivePacket() { if(code == CodeSoh) { - uint32_t len = read(&(rxBuffer[rxLength]), YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - rxLength); + int32_t len = read(&(rxBuffer[rxLength]), YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - rxLength); if(len < (YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - rxLength)) { @@ -332,7 +332,7 @@ Ymodem::Code Ymodem::receivePacket() } else if(code == CodeStx) { - uint32_t len = read(&(rxBuffer[rxLength]), YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - rxLength); + int32_t len = read(&(rxBuffer[rxLength]), YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - rxLength); if(len < (YMODEM_PACKET_1K_SIZE + YMODEM_PACKET_OVERHEAD - rxLength)) {