From 6c61629da200e681d99a8b55a33c979bcdf9dbf3 Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Sun, 11 Sep 2016 13:53:12 +0000 Subject: [PATCH] zero out spi structure before use fixes issue #1 --- generic/spi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/spi.c b/generic/spi.c index 08a42ae..ae57fde 100644 --- a/generic/spi.c +++ b/generic/spi.c @@ -95,6 +95,9 @@ tclspi_spiObjectObjCmd(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Obj * int ret; int length; + // zero out the spi structure + memset (&spi, 0, sizeof(spi)); + // obj transfer data delay if (objc != 4) { Tcl_WrongNumArgs (interp, 2, objv, "writeData delayUsecs");