summaryrefslogtreecommitdiff
path: root/pkg/pack/pack.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/pack/pack.go')
-rw-r--r--pkg/pack/pack.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/pack/pack.go b/pkg/pack/pack.go
index e186773..0511df8 100644
--- a/pkg/pack/pack.go
+++ b/pkg/pack/pack.go
@@ -29,7 +29,7 @@ func NewDecoder(r Reader) *Decoder {
func (e *Encoder) Lps(b []byte) error {
buf := make([]byte, binary.MaxVarintLen64)
- n := binary.PutVarint(buf, int64(len(b)))
+ n := binary.PutUvarint(buf, uint64(len(b)))
if _, err := e.w.Write(buf[:n]); err != nil {
return err
@@ -40,7 +40,7 @@ func (e *Encoder) Lps(b []byte) error {
}
func (d *Decoder) Lps() ([]byte, error) {
- if n, err := binary.ReadVarint(d.r); err != nil {
+ if n, err := binary.ReadUvarint(d.r); err != nil {
return nil, fmt.Errorf("lps: %w", err)
} else {
buf := make([]byte, n)