mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Fix zero lenght packets bug
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user