explicitly discard opening END when SLIP decoding

This commit is contained in:
2025-05-19 09:23:57 -05:00
committed by GitHub
parent 87853b8ccb
commit 039d4e6f1a
+4 -1
View File
@@ -78,7 +78,10 @@ func (s *SLIP) decode(bytes []byte) {
}
escapeNext = false
} else if packetByte == END {
if len(s.pendingBytes) > 0 {
if len(s.pendingBytes) == 0 {
// opening END byte, can discard
continue
} else {
message, err := osc.MessageFromBytes(s.pendingBytes)
if err != nil {
fmt.Println(err)