summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-02 23:06:22 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-02 23:06:31 +0100
commit8dac8942dcae2bb35212aa4ff5488bd8dcda1fad (patch)
tree07445ffbf1c19c8dc8816056e869dcd9d168b7b5
parent8e9b03928613c75befe059e772e7bdbb3109c350 (diff)
Fix: Make sure can_message_t.data_ member has been
clear before use it again. Change-Id: Ib073d67651cd3272190ef7464e806cf1f22b4cf3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--src/can-message.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/can-message.cpp b/src/can-message.cpp
index 3905943..5d01880 100644
--- a/src/can-message.cpp
+++ b/src/can-message.cpp
@@ -152,6 +152,7 @@ void can_message_t::set_data(const __u8* new_data)
{
int i;
+ data_.clear();
/* maxdlen_ is now set at CAN_MAX_DLEN or CANFD_MAX_DLEN, respectively 8 and 64 bytes*/
for(i=0;i<maxdlen_;i++)
{