From 730409458d6bbd8de3010a64ea04f24dde74b453 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 27 Sep 2019 13:55:00 -0400 Subject: [PATCH] Fix switches array size in QuickJS. --- src/QuickJSEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QuickJSEngine.cpp b/src/QuickJSEngine.cpp index fb967e2..2dd8cea 100644 --- a/src/QuickJSEngine.cpp +++ b/src/QuickJSEngine.cpp @@ -162,7 +162,7 @@ struct QuickJSEngine : ScriptEngine { JS_SetPropertyStr(ctx, blockIdx, "knobs", knobsIdx); // switches - JSValue switchesIdx = JS_NewArrayBuffer(ctx, (uint8_t *) &block->switches, sizeof(bool) * block->bufferSize, NULL, NULL, true); + JSValue switchesIdx = JS_NewArrayBuffer(ctx, (uint8_t *) &block->switches, sizeof(bool) * NUM_ROWS, NULL, NULL, true); JS_SetPropertyStr(ctx, blockIdx, "switches", switchesIdx); // lights