mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-14 07:56: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;
|
FUNC_ENTRY;
|
||||||
if (length > 255)
|
if (length > 255)
|
||||||
{
|
{
|
||||||
buf[rc++] = 0x01;
|
writeChar(&buf, 0x01);
|
||||||
writeInt(&buf, length);
|
writeInt(&buf, length);
|
||||||
rc += 2;
|
rc += 3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
buf[rc++] = length;
|
buf[rc++] = length;
|
||||||
|
|||||||
Reference in New Issue
Block a user