|
|
@ -159,8 +159,7 @@ const MatrixEmulatorENV = "MATRIX_EMULATOR"
|
|
|
|
func stringsToC(s []string) **C.char {
|
|
|
|
func stringsToC(s []string) **C.char {
|
|
|
|
cArray := C.malloc(C.size_t(len(s)) * C.size_t(unsafe.Sizeof(uintptr(0))))
|
|
|
|
cArray := C.malloc(C.size_t(len(s)) * C.size_t(unsafe.Sizeof(uintptr(0))))
|
|
|
|
|
|
|
|
|
|
|
|
arglen := len(s) - 1
|
|
|
|
a := (*[1<<30 - 1]*C.char)(cArray)
|
|
|
|
a := (*[arglen]*C.char)(cArray)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for idx, substring := range s {
|
|
|
|
for idx, substring := range s {
|
|
|
|
a[idx] = C.CString(substring)
|
|
|
|
a[idx] = C.CString(substring)
|
|
|
|