Skip to content

Commit

Permalink
cli/object: Allow zero ranges in range and hash commands
Browse files Browse the repository at this point in the history
Follow nspcc-dev/neofs-api#313.

Closes #3071.

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
  • Loading branch information
cthulhu-rider committed Feb 24, 2025
1 parent 3980b72 commit 782c87c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/neofs-cli/modules/object/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ func getRangeList(cmd *cobra.Command) ([]*object.Range, error) {
}

if length == 0 {
return nil, fmt.Errorf("invalid '%s' range: zero length", vs[i])
}

if offset+length <= offset {
if offset != 0 {
return nil, fmt.Errorf("invalid '%s' range: zero length with non-zero offset", vs[i])
}
} else if offset+length <= offset {

Check warning on line 208 in cmd/neofs-cli/modules/object/range.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/object/range.go#L205-L208

Added lines #L205 - L208 were not covered by tests
return nil, fmt.Errorf("invalid '%s' range: uint64 overflow", vs[i])
}

Expand Down

0 comments on commit 782c87c

Please sign in to comment.