Skip to content

Commit

Permalink
SocketsTest.testReaderIP(): Zero terminate received buffer
Browse files Browse the repository at this point in the history
Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
  • Loading branch information
laf0rge committed Oct 21, 2018
1 parent e7d267f commit f5e1cf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/CommonLibs/SocketsTest.cpp
Expand Up @@ -47,9 +47,10 @@ void *testReaderIP(void *param)
readSocket->nonblocking();
int rc = 0;
while (rc<gNumToSend) {
char buf[MAX_UDP_LENGTH] = { 0 };
char buf[MAX_UDP_LENGTH+1] = { 0 };
int count = readSocket->read(buf, MAX_UDP_LENGTH);
if (count>0) {
buf[count] = 0;
CERR("read: " << buf);
rc++;
} else {
Expand Down

0 comments on commit f5e1cf8

Please sign in to comment.