Add NULL termination to payloads

Messages addressed to "this" node, will have a null char
appended to the payload after message verification is
done, because some "getters" assume the message being a
string.
This commit is contained in:
Patrick Fallberg
2016-02-07 12:48:36 +01:00
parent 060de48f29
commit 59550410a3
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -620,6 +620,7 @@ boolean MySensor::process() {
if (destination == nc.nodeId) {
// This message is addressed to this node
mSetSigned(msg,0);
msg.data[mGetLength(msg)] = '\0'; // Add NULL termination so that "getters" works as expected
if (repeaterMode && last != nc.parentNodeId) {
// Message is from one of the child nodes. Add it to routing table.
+1 -1
View File
@@ -6,6 +6,6 @@
#ifndef Version_h
#define Version_h
#define LIBRARY_VERSION "1.5.3"
#define LIBRARY_VERSION "1.5.4"
#endif