Closed fkaup closed 1 year ago
String.length() returns string length without null terminator, so fix must be right. If we are reading that and place null into the last position, making last character to be lost. I'll add fix into master.
it is just that we are now trying to read one character more than available from textPayload
- which is then mitigated by the getBytes
function limiting it again to textPayload
size. So, it works but is not clean.
Issue seems to be in loraprs_service.cpp lines 505ff:
I updated above lines to work. Still, it should not work as that because we are reading more bytes than we should have in textPayload. Still, reducing
textPayload.getBytes(buf, bytesWritten-1);
again misses the last character of the message. I don´t know what is wrong here and how to properly fix it.