Skip to content

Commit

Permalink
πŸ›: use vector and underlying data instead of dynamic array
Browse files Browse the repository at this point in the history
  • Loading branch information
mguentner committed Nov 18, 2023
1 parent a2cf333 commit 706d3b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion udpthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ bool UDPThread::parsePacket(uint8_t *buffer, uint16_t len, struct sockaddr_stora
void UDPThread::run() {
fd_set readfds;
ssize_t receivedBytes;
uint8_t buffer[m_linkMtuSize];
std::vector<uint8_t> bufferVector(m_linkMtuSize);
uint8_t *buffer = bufferVector.data();
struct sockaddr_storage clientAddr;
socklen_t clientAddrLen = sizeof(clientAddr);

Expand Down

0 comments on commit 706d3b0

Please sign in to comment.