From b3ebf73ecc33513aab4d602505559e54c3966987 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 5 Nov 2018 18:45:46 +0100 Subject: [PATCH] chg: lua - Swapping param order to make it more clear. From (length,offset) to (offset,length) --- client/scripting.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/scripting.c b/client/scripting.c index 2a7baed0d..06356293f 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -66,8 +66,8 @@ static int l_GetFromBigBuf(lua_State *L){ return 2; // two return values } if (n >= 2) { - len = luaL_checknumber(L, 1); - startindex = luaL_checknumber(L, 2); + startindex = luaL_checknumber(L, 1); + len = luaL_checknumber(L, 2); } uint8_t *data = calloc(len, sizeof(uint8_t)); @@ -115,8 +115,8 @@ static int l_GetFromFlashMem(lua_State *L){ return 2; } if (n >= 2) { - len = luaL_checknumber(L, 1); - startindex = luaL_checknumber(L, 2); + startindex = luaL_checknumber(L, 1); + len = luaL_checknumber(L, 2); } uint8_t *data = calloc(len, sizeof(uint8_t));