Skip to content

Commit 5707a0d

Browse files
authored
fix: check count dimensions in slices (#19)
1 parent cc59b24 commit 5707a0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

netcdf/netcdf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func okDataSlice(a sliceableTypedArray, t Type, n int, start, count []uint64) er
6161
if len(start) != len(d) {
6262
return fmt.Errorf("incorrect number of dimensions in start: %d != %d", start, len(d))
6363
}
64-
if len(start) != len(d) {
64+
if len(count) != len(d) {
6565
return fmt.Errorf("incorrect number of dimensions in count: %d != %d", count, len(d))
6666
}
6767

@@ -99,7 +99,7 @@ func okDataStride(a sliceableTypedArray, t Type, n int, start, count []uint64, s
9999
if len(start) != len(d) {
100100
return fmt.Errorf("incorrect number of dimensions in start: %d != %d", start, len(d))
101101
}
102-
if len(start) != len(d) {
102+
if len(count) != len(d) {
103103
return fmt.Errorf("incorrect number of dimensions in count: %d != %d", count, len(d))
104104
}
105105
if len(stride) != len(d) {

0 commit comments

Comments
 (0)