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.
-
2 out of 2
Suggested Topics
-
Code for beta-testing?
Controllers • 24 Mar 2014, 20:48 • andriej 9 Aug 2014, 10:44 -
Making WiFiManager compatible with MySensors 2.3.2
Bug Reports • 12 Feb 2020, 21:43 • pihome 1 Jun 2022, 16:02 -
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 -
RFM95W sleep() directly after send() often doesn't sleep radio
Bug Reports • 1 Jan 2023, 18:41 • prawnpie 8 Jan 2023, 05:36 -
sleep(0) in V2.1 doesn't sleep indefinitely anymore. Used to powerdown and sleep in V1.5
Bug Reports • 22 Nov 2019, 00:35 • GaryStofer 15 Apr 2023, 05:50 -
some differences between serial- and tcp-gateways.
Bug Reports • 15 Mar 2023, 09:26 • Branther 30 Mar 2023, 15:40