Skip to content

Commit

Permalink
fixed readSize for SimpleSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuyuan committed Feb 8, 2021
1 parent 45c6fee commit 8b287ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/network/SimpleSocket.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* */
/* CSimpleSocket.cpp - CSimpleSocket Implementation */
/* */
Expand Down Expand Up @@ -225,7 +225,7 @@ size_t CSimpleSocket::available() {
std::string CSimpleSocket::readSize(size_t size) {
std::string buffer;
uint8_t *buffer_ = static_cast<uint8_t *>(alloca(size * sizeof(uint8_t)));
size_t bytes_read = this->writeData(buffer_, size);
size_t bytes_read = this->readData(buffer_, size);
buffer.append(reinterpret_cast<const char *>(buffer_), bytes_read);
return buffer;
}
Expand Down

0 comments on commit 8b287ed

Please sign in to comment.