diff --git a/decode_bytes.go b/decode_bytes.go index 2b13311..e563c4a 100644 --- a/decode_bytes.go +++ b/decode_bytes.go @@ -65,10 +65,11 @@ func (d *bytesDecoder) decode(buf []byte, cursor int64, p unsafe.Pointer) (int64 cursor = c decodedLen := base64.StdEncoding.DecodedLen(len(bytes)) b := make([]byte, decodedLen) - if _, err := base64.StdEncoding.Decode(b, bytes); err != nil { + n, err := base64.StdEncoding.Decode(b, bytes) + if err != nil { return 0, err } - *(*[]byte)(p) = b + *(*[]byte)(p) = b[:n] return cursor, nil } diff --git a/decode_test.go b/decode_test.go index ff64165..5e401aa 100644 --- a/decode_test.go +++ b/decode_test.go @@ -1864,6 +1864,7 @@ func TestUnmarshalMarshal(t *testing.T) { return } } +*/ var numberTests = []struct { in string @@ -1916,6 +1917,7 @@ func TestLargeByteSlice(t *testing.T) { } } +/* type Xint struct { X int }