diff --git a/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.cpp b/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.cpp index ed230762d821de4fef3e400bb9280066dbeec877..26a7dd83ddcfd736b85cc4466686c9ea93c02809 100644 --- a/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.cpp +++ b/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.cpp @@ -338,7 +338,7 @@ namespace armarx << " bytes for messages buffer, but the maximal buffer size is " << getMaximalBufferSize(); } - bufferSize = std::max(requiredSpace, getMaximalBufferSize()); + bufferSize = std::min(requiredSpace, getMaximalBufferSize()); buffer.resize(bufferSize, 0); requiredAdditionalBufferSpace = 0; messagesLost = 0;