diff --git a/datagram.go b/datagram.go index 7277065..3417eba 100644 --- a/datagram.go +++ b/datagram.go @@ -30,7 +30,7 @@ func NewDatagramFrom(r io.Reader) (*Datagram, error) { return nil, err } - if !bytes.Equal([]byte{Reserved, Reserved}, buf[:1]) { + if !bytes.Equal([]byte{Reserved, Reserved}, buf[:2]) { return nil, ErrBadDatagram }