diff --git a/hazelcast/src/hazelcast/util/ByteBuffer.cpp b/hazelcast/src/hazelcast/util/ByteBuffer.cpp index db77643443..7cdb2e71df 100644 --- a/hazelcast/src/hazelcast/util/ByteBuffer.cpp +++ b/hazelcast/src/hazelcast/util/ByteBuffer.cpp @@ -136,7 +136,7 @@ namespace hazelcast { size_t ByteBuffer::readBytes(byte *target, size_t len) { size_t numBytesToCopy = std::min(lim - pos, len); memcpy(target, ix(), numBytesToCopy); - pos += len; + pos += numBytesToCopy; return numBytesToCopy; } } diff --git a/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp b/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp index a1fba87ebb..154926d3cc 100644 --- a/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp +++ b/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp @@ -48,6 +48,8 @@ namespace hazelcast { util::Thread t(testLatchThread, l.get()); ASSERT_TRUE(l->await(10 * 1000)); + + t.join(); } }