less save
Some checks failed
Build and Publish / BuildAndDeploy (push) Has been cancelled

This commit is contained in:
matst80
2024-11-11 18:00:33 +01:00
parent 5f48a845b1
commit f158a54e86
3 changed files with 8 additions and 3 deletions

View File

@@ -35,6 +35,9 @@ func ReadCartPacket(conn io.Reader, packet *CartPacket) error {
}
func GetPacketData(conn io.Reader, len uint64) ([]byte, error) {
if len == 0 {
return []byte{}, nil
}
data := make([]byte, len)
_, err := conn.Read(data)
return data, err