From 3df1c6c2807ff5258506c928cc3cb6862b704b39 Mon Sep 17 00:00:00 2001 From: Michael Mitton Date: Fri, 18 Feb 2011 13:15:48 -0500 Subject: Fixed encoding length --- ber.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ber.go b/ber.go index 5e2fc0d..058fd48 100644 --- a/ber.go +++ b/ber.go @@ -351,7 +351,7 @@ func (p *Packet) Bytes() []byte { var out bytes.Buffer out.Write( []byte { p.ClassType | p.TagType | p.Tag } ) packet_length := EncodeInteger( p.DataLength() ) - if len( packet_length ) > 1 { + if p.DataLength() > 127 || len( packet_length ) > 1 { out.Write( []byte { byte( len( packet_length ) | 128 ) } ) out.Write( packet_length ) } else { -- cgit v1.2.3