fix buffer size

This commit is contained in:
YouROK
2021-03-03 09:14:34 +03:00
parent b5f9719613
commit d488b9d0ad

View File

@@ -32,7 +32,7 @@ func (p *Piece) WriteAt(b []byte, off int64) (n int, err error) {
if p.buffer == nil {
go p.cache.cleanPieces()
p.buffer = make([]byte, p.cache.pieceLength)
p.buffer = make([]byte, p.cache.pieceLength, p.cache.pieceLength)
}
n = copy(p.buffer[off:], b[:])
p.Size += int64(n)