Skip to content

Commit

Permalink
Update buffer reader
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 committed Jan 22, 2025
1 parent 0c00a94 commit afc5e9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/core/src/clp/BufferReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ auto BufferReader::try_read(char* buf, size_t num_bytes_to_read, size_t& num_byt
throw OperationFailed(ErrorCode_BadParam, __FILENAME__, __LINE__);
}

if (0 == num_bytes_to_read) {
num_bytes_read = 0;
return ErrorCode_Success;
}

auto remaining_data_size = get_remaining_data_size();
if (0 == remaining_data_size) {
return ErrorCode_EndOfFile;
Expand Down

0 comments on commit afc5e9e

Please sign in to comment.