Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 33b0f5e

Browse files
author
Thorsten Riess
committed
Length back to int
1 parent d3d33c6 commit 33b0f5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sequence.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ func PyByteArray_AsBytes(self *PyObject) []byte {
9797
}
9898

9999
// PyByteArray_AsBytesN returns the contents of bytearray as []bytes, size length
100-
func PyByteArray_AsBytesN(self *PyObject, length uint64) []byte {
101-
blength := uint64(C._gopy_PyByteArray_GET_SIZE(topy(self)))
102-
if blength < length {
100+
func PyByteArray_AsBytesN(self *PyObject, length int) []byte {
101+
blength := int(C._gopy_PyByteArray_GET_SIZE(topy(self)))
102+
if (blength < length) || (length < 0) {
103103
panic("bytearray length out of range")
104104
}
105105
c_str := C.PyByteArray_AsString(topy(self))

0 commit comments

Comments
 (0)