Skip to content

Commit

Permalink
CBlockedSerialInputStream::read fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Jun 7, 2024
1 parent bce418c commit 13194ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/jlib/jstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ class CBlockedSerialInputStream : public CInterfaceOf<IBufferedSerialInputStream
// Will set endOfStream if there is no more to read - do not uncommon special case end-of-file here.
readNextBlock();

size32_t toCopy = std::min(len, available());
size32_t remainingLen = len - sizeRead;
size32_t toCopy = std::min(remainingLen, available());
memcpy(target + sizeRead, data(bufferOffset), toCopy);
bufferOffset += toCopy;
sizeRead += toCopy;
Expand Down

0 comments on commit 13194ad

Please sign in to comment.