From 6456d4e261ed7a72bb42bd285c39c0b18a5dde43 Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Mon, 22 Oct 2018 16:19:20 -0400 Subject: [PATCH] Fix a bug where polling messages would not work properly --- device/device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);