diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 763156d86..cff5acbd1 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -2190,7 +2190,7 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm const char* memDna = btDefaultSerializer::getMemoryDna(); if (sz < bufferSizeInBytes) { - for (int i = 0; i < bufferSizeInBytes; i++) + for (int i = 0; i < sz; i++) { bufferServerToClient[i] = memDna[i]; } diff --git a/test/SharedMemory/test.c b/test/SharedMemory/test.c index a1a6591d8..6037b693e 100644 --- a/test/SharedMemory/test.c +++ b/test/SharedMemory/test.c @@ -228,7 +228,7 @@ void testSharedMemory(b3PhysicsClientHandle sm) #endif } ///perform some simulation steps for testing - for ( i=0;i<10000;i++) + for ( i=0;i<1000;i++) { b3SharedMemoryStatusHandle statusHandle; int statusType;