summaryrefslogtreecommitdiff
path: root/pkg/pack
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2020-03-11 13:15:30 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2020-03-11 13:15:38 +0300
commita18edd22eb72549aefd35db0165111586ff21355 (patch)
tree9149d63fcd517942ed3b45c3454d36cadbe2d744 /pkg/pack
parent76012e39e9201b9dfcbbad546c7c2b38512903cb (diff)
auth with pack
Diffstat (limited to 'pkg/pack')
-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)