Skip to content

Commit 3f47408

Browse files
authored
Fix read data overwrite issue
2 parents 43a396f + 933513f commit 3f47408

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/USBHostSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ std::size_t USBHostSerial::read(uint8_t *dest, std::size_t size) {
121121
while (size > pxItemSize) {
122122
void *ret = xRingbufferReceiveUpTo(_rx_buf_handle, &pxItemSize, pdMS_TO_TICKS(1), size - pxItemSize);
123123
if (ret) {
124-
std::memcpy(dest, ret, pxItemSize);
124+
std::memcpy(dest + retVal, ret, pxItemSize);
125125
retVal += pxItemSize;
126126
vRingbufferReturnItem(_rx_buf_handle, ret);
127127
} else {

0 commit comments

Comments
 (0)