diff options
| author | Michael Mitton <[email protected]> | 2011-02-18 13:15:48 -0500 |
|---|---|---|
| committer | Michael Mitton <[email protected]> | 2011-02-18 13:15:48 -0500 |
| commit | 3df1c6c2807ff5258506c928cc3cb6862b704b39 (patch) | |
| tree | 6122f88a23158fcf020883a4c35314680f2bbc5c | |
| parent | 45715bd42227aa7040c95b2831e24ae3d0c93e29 (diff) | |
Fixed encoding length
| -rw-r--r-- | ber.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 { |
