String message length
-
In MyMessage.c is length of string message incorrect for longer messages. Right now is:
MyMessage& MyMessage::set(const char* value) {
uint8_t length = strlen(value);
miSetLength(length);
miSetPayloadType(P_STRING);
strncpy(data, value, min(length, MAX_PAYLOAD));
return *this;
}Correct calculation of length is:
MyMessage& MyMessage::set(const char* value) {
** uint8_t length = min(strlen(value), MAX_PAYLOAD);**
miSetLength(length);
miSetPayloadType(P_STRING);
** strncpy(data, value, length);**
return *this;
}I have problems in EasyIoT server if gw.sendSketchInfo text is longer than 24 characters. I've added additional checks but it's right to fix problem at source.
-
1 out of 2
Suggested Topics
-
Code for beta-testing?
Controllers • 24 Mar 2014, 20:48 • andriej 9 Aug 2014, 10:44 -
Boards esp8266 v3.1.0 or Newer Doesn't Work with MySensors
Bug Reports • 21 Feb 2023, 01:55 • d-smes 25 Feb 2023, 19:37 -
Making WiFiManager compatible with MySensors 2.3.2
Bug Reports • 12 Feb 2020, 21:43 • pihome 1 Jun 2022, 16:02 -
Sensor presentation failure
Bug Reports • 31 Jul 2016, 19:23 • Sergio Rius 3 Mar 2021, 18:48 -
NRF51-52 PA not support ???
Bug Reports • 23 Feb 2019, 16:40 • berkseo 8 Jul 2021, 11:42 -
RFM95W sleep() directly after send() often doesn't sleep radio
Bug Reports • 1 Jan 2023, 18:41 • prawnpie 8 Jan 2023, 05:36