SocketsTest.testReaderIP(): Zero terminate received buffer

Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
changes/05/11405/1
Harald Welte 4 years ago
parent e7d267f178
commit f5e1cf8790
  1. 3
      tests/CommonLibs/SocketsTest.cpp

@ -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 {

Loading…
Cancel
Save