Browse Source

Fix zero lenght packets bug

release/3.x.x
Israel Lot 6 years ago
parent
commit
e006377e64
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs

+ 2
- 2
Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs View File

@@ -58,9 +58,9 @@ namespace MQTTnet.Serializer

public static byte[] GetRemainingLength(int length)
{
if (length == 0)
if (length <= 0)
{
return new byte[] { (byte)0 };
return new [] { (byte)0 };
}

var bytes = new byte[4];


Loading…
Cancel
Save