瀏覽代碼

Fix zero lenght packets bug

release/3.x.x
Israel Lot 6 年之前
父節點
當前提交
e006377e64
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs

+ 2
- 2
Frameworks/MQTTnet.NetStandard/Serializer/MqttPacketWriter.cs 查看文件

@@ -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…
取消
儲存