This commit is contained in:
Josh Deprez 2021-01-11 13:59:50 +11:00
parent fac81285da
commit dc10d3b6de

View file

@ -97,7 +97,7 @@ func (c *sungrowConn) Read(out []byte) (int, error) {
pktlen, padlen := int(hdr[2]), int(hdr[3])
bs := c.block.BlockSize()
if (pktlen+padlen)%bs != 0 {
return 0, fmt.Errorf("pktlen + padlen = %d + %d = %d, want divisble by %d", pktlen, padlen, pktlen+padlen, bs)
return 0, fmt.Errorf("pktlen + padlen = %d + %d = %d, want divisible by %d", pktlen, padlen, pktlen+padlen, bs)
}
pkt := make([]byte, pktlen+padlen)
if _, err := io.ReadFull(c.Conn, pkt); err != nil {