mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 07:26:52 +01:00
packet length field is mal formed if length > 255 #19
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -64,9 +64,9 @@ int MQTTSNPacket_encode(unsigned char* buf, int length)
|
||||
FUNC_ENTRY;
|
||||
if (length > 255)
|
||||
{
|
||||
buf[rc++] = 0x01;
|
||||
writeChar(&buf, 0x01);
|
||||
writeInt(&buf, length);
|
||||
rc += 2;
|
||||
rc += 3;
|
||||
}
|
||||
else
|
||||
buf[rc++] = length;
|
||||
|
||||
Reference in New Issue
Block a user