diff --git a/library/DFProcess-linux-SHM.cpp b/library/DFProcess-linux-SHM.cpp index 4e0b50e1c..d4f90db93 100644 --- a/library/DFProcess-linux-SHM.cpp +++ b/library/DFProcess-linux-SHM.cpp @@ -609,7 +609,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff else { // first read equals the size of the SHM window - uint32_t to_read = SHM_BODY - 1024; + uint32_t to_read = SHM_BODY; while (size) { // read to_read bytes from src_cursor @@ -617,7 +617,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff D_SHMHDR->length = to_read; gcc_barrier d->SetAndWait(CORE_READ); - memcpy (target_buffer, D_SHMDATA(void) ,size); + memcpy (target_buffer, D_SHMDATA(void) ,to_read); // decrease size by bytes read size -= to_read; // move the cursors diff --git a/library/DFProcess-windows-SHM.cpp b/library/DFProcess-windows-SHM.cpp index 20b5dafd6..9a8bd8d4f 100644 --- a/library/DFProcess-windows-SHM.cpp +++ b/library/DFProcess-windows-SHM.cpp @@ -678,7 +678,7 @@ void SHMProcess::read (uint32_t src_address, uint32_t size, uint8_t *target_buff D_SHMHDR->length = to_read; full_barrier d->SetAndWait(CORE_READ); - memcpy (target_buffer, D_SHMDATA(void) ,size); + memcpy (target_buffer, D_SHMDATA(void) ,to_read); // decrease size by bytes read size -= to_read; // move the cursors