From 823b97b6d985e083cb11bff9c4f799ab369de35e Mon Sep 17 00:00:00 2001 From: tekka007 Date: Thu, 31 Dec 2015 13:19:12 +0100 Subject: [PATCH] Last byte clearing is sufficient --- libraries/MySensors/core/MyTransport.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/MySensors/core/MyTransport.cpp b/libraries/MySensors/core/MyTransport.cpp index fd823f1..537d191 100644 --- a/libraries/MySensors/core/MyTransport.cpp +++ b/libraries/MySensors/core/MyTransport.cpp @@ -140,9 +140,8 @@ inline void transportProcess() { if (destination == _nc.nodeId) { // This message is addressed to this node mSetSigned(_msg,0); // Clear the sign-flag now as verification is completed - // clear bytes after message end - memset((uint8_t*)&_msg.data[messageLength],0x00,MAX_PAYLOAD-messageLength+1); - + // null terminate data + _msg.data[messageLength] = 0x00; #if defined(MY_REPEATER_FEATURE) if (_msg.last != _nc.parentNodeId) { // Message is from one of the child nodes. Add it to routing table.