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 5620800 commit b10d3f7Copy full SHA for b10d3f7
src/Samba.cpp
@@ -378,7 +378,7 @@ Samba::readXmodem(uint8_t* buffer, int size)
378
379
_port->put(ACK);
380
381
- memcpy(buffer, &blk[3], min(size, BLK_SIZE));
+ memmove(buffer, &blk[3], min(size, BLK_SIZE));
382
buffer += BLK_SIZE;
383
size -= BLK_SIZE;
384
blkNum++;
@@ -418,7 +418,7 @@ Samba::writeXmodem(const uint8_t* buffer, int size)
418
blk[0] = SOH;
419
blk[1] = (blkNum & 0xff);
420
blk[2] = ~(blkNum & 0xff);
421
- memcpy(&blk[3], buffer, min(size, BLK_SIZE));
+ memmove(&blk[3], buffer, min(size, BLK_SIZE));
422
if (size < BLK_SIZE)
423
memset(&blk[3] + size, 0, BLK_SIZE - size);
424
crc16Add(blk);
0 commit comments