From 39fb76bcc6694e7d9c0267b4067c3c0e434c9598 Mon Sep 17 00:00:00 2001 From: Brendan Porter Date: Fri, 17 Aug 2018 13:34:43 -0500 Subject: [PATCH] trying to fix gpio_slowdown --- matrix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matrix.go b/matrix.go index 2d3a3fd..2d80aeb 100644 --- a/matrix.go +++ b/matrix.go @@ -159,7 +159,8 @@ const MatrixEmulatorENV = "MATRIX_EMULATOR" func stringsToC(s []string) **C.char { cArray := C.malloc(C.size_t(len(s)) * C.size_t(unsafe.Sizeof(uintptr(0)))) - a := (*[len(s) - 1]*C.char)(cArray) + arglen := len(s) - 1 + a := (*[arglen]*C.char)(cArray) for idx, substring := range s { a[idx] = C.CString(substring)