diff --git a/device/device.cpp b/device/device.cpp index 55d8aa8..a7a7f36 100644 --- a/device/device.cpp +++ b/device/device.cpp @@ -101,7 +101,7 @@ bool Device::getMessages(std::vector>& container, size_ if(limit > (pollingContainer.size_approx() + 4)) limit = (pollingContainer.size_approx() + 4); - if(container.capacity() < limit) + if(container.size() < limit) container.resize(limit); size_t actuallyRead = pollingContainer.try_dequeue_bulk(container.data(), limit);