summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/can-message.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/can-message.cpp b/src/can-message.cpp
index 5a3e2c27..63f8a909 100644
--- a/src/can-message.cpp
+++ b/src/can-message.cpp
@@ -182,7 +182,8 @@ void can_message_t::convert_from_canfd_frame(const std::pair<struct canfd_frame&
if(maxdlen_ == CANFD_MAX_DLEN)
set_flags(frame.flags);
- data_.reserve(maxdlen_);
+ if ( data_.capacity() < maxdlen_)
+ data_.reserve(maxdlen_);
set_data(frame.data);
DEBUG(binder_interface, "convert_from_canfd_frame: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", id_, format_, length_,