From 1a0310848f49d81c24dd293acee95ca254312599 Mon Sep 17 00:00:00 2001 From: Will Scott Date: Thu, 3 Mar 2022 19:06:38 +0100 Subject: [PATCH] fix section reader --- traversal/selector/matcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traversal/selector/matcher.go b/traversal/selector/matcher.go index 38314db4..4186221f 100644 --- a/traversal/selector/matcher.go +++ b/traversal/selector/matcher.go @@ -55,7 +55,7 @@ func (s Slice) Slice(n datamodel.Node) (datamodel.Node, error) { return nil, err } - sr := io.NewSectionReader(readerat{rdr}, s.From, s.To) + sr := io.NewSectionReader(readerat{rdr}, s.From, s.To-s.From) return basicnode.NewBytesFromReader(sr), nil } bytes, err := n.AsBytes()