diff --git a/container.go b/container.go index 2a99c72..f542cf8 100644 --- a/container.go +++ b/container.go @@ -295,7 +295,7 @@ return nil, ErrNoSnapshot } - gosnapshots := (*[1 << 30]C.struct_lxc_snapshot)(unsafe.Pointer(csnapshots))[:size:size] + gosnapshots := (*[(1 << 30) - 1]C.struct_lxc_snapshot)(unsafe.Pointer(csnapshots))[:size:size] snapshots := make([]Snapshot, size, size) for i := 0; i < size; i++ { snapshots[i] = Snapshot{ diff --git a/util.go b/util.go index 40ba65c..65fdd83 100644 --- a/util.go +++ b/util.go @@ -81,7 +81,7 @@ return nil } - tmpslice := (*[1 << 30]*C.char)(unsafe.Pointer(cArgs))[:size:size] + tmpslice := (*[(1 << 29) - 1]*C.char)(unsafe.Pointer(cArgs))[:size:size] result := make([]string, size) for i, s := range tmpslice { result[i] = C.GoString(s)