@cryptotaxi247 / kubo / commits / da47c218b

take offset into account for computing read size

Jeromy committed Mar 6, 2015 at 11:07 UTC da47c218b79912e2528d10cce33b66c18882a0de
1 file changed +1 -1
fuse/readonly/readonly_unix.go
+1 -1
@@ -170,7 +170,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
170 return err
171 }
172
173 - buf := resp.Data[:min(req.Size, int(r.Size()))]
173 + buf := resp.Data[:min(req.Size, int(r.Size()-req.Offset))]
174 n, err := io.ReadFull(r, buf)
175 if err != nil && err != io.EOF {
176 return err