aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
Diffstat (limited to 'ber')
-rw-r--r--ber/class.go2
-rw-r--r--ber/int.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/ber/class.go b/ber/class.go
index 0839c05..0a98b80 100644
--- a/ber/class.go
+++ b/ber/class.go
@@ -119,7 +119,7 @@ func Ident(b []byte) (Class, Kind, Tag, int) {
func Length(b []byte) (int, int) {
if b[0] & 0x80 != 0 {
- l := b[0] & 0x7f
+ l := int(b[0] & 0x7f)
i := unmarshalUint(b[1:l+1])
return int(i), int(l+1)
} else {
diff --git a/ber/int.go b/ber/int.go
index 5bfcd89..bbf93ea 100644
--- a/ber/int.go
+++ b/ber/int.go
@@ -34,7 +34,7 @@ func unmarshalInt(b []byte) (i int64) {
func unmarshalUint(b []byte) (i int64) {
for n, v := range b {
- i += int64(v) << uint((n-1)*8)
+ i += int64(v) << uint(n*8)
}
return
}