fs/torrentfs.go | 4 ++-- diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 7a00f28806a7bef86bbd3e8c77dd921dddb8b491..eb6c43f9f14e9eb30068ccdd051a6f22478a569e 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -56,8 +56,8 @@ size := req.Size if int64(fn.size)-req.Offset < int64(size) { size = int(int64(fn.size) - req.Offset) } - if size == 0 { - return nil + if size < 0 { + size = 0 } infoHash := torrent.BytesInfoHash(fn.metaInfo.InfoHash) torrentOff := fn.TorrentOffset + req.Offset