diff options
-rw-r--r-- | CommonLibs/SocketsTest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CommonLibs/SocketsTest.cpp b/CommonLibs/SocketsTest.cpp index c2849e0..3198a5e 100644 --- a/CommonLibs/SocketsTest.cpp +++ b/CommonLibs/SocketsTest.cpp @@ -61,7 +61,8 @@ void *testReaderUnix(void *) readSocket.nonblocking(); int rc = 0; while (rc<gNumToSend) { - char buf[MAX_UDP_LENGTH]; + char buf[MAX_UDP_LENGTH+1]; + buf[MAX_UDP_LENGTH] = '\0'; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { COUT("read: " << buf); |