From 7de458486f05b4534d3143073bb4493458b6d3fc Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 3 Feb 2018 22:47:17 +0100 Subject: [PATCH] adjustments, still breaks on ubuntu, --- client/scripting.c | 7 +++---- client/scripts/e.lua | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/scripting.c b/client/scripting.c index 899f14d97..4f2c2f069 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -459,15 +459,14 @@ static int l_reveng_models(lua_State *L){ // This array needs to be adjusted if RevEng adds more crc-models. uint8_t width[102]; + memset(width, 0, sizeof(width)); // This array needs to be adjusted if RevEng adds more crc-models. char *models[102]; width[0] = in_width; - int ans = GetModels(models, &count, width); - if (!ans) { - return returnToLuaWithError(L, "Didn't find any models"); - } + if (!GetModels(models, &count, width)) + return returnToLuaWithError(L, "didn't find any models"); lua_newtable(L); for (int i = 0; i < count; i++){ diff --git a/client/scripts/e.lua b/client/scripts/e.lua index d6db95f35..4e032337e 100644 --- a/client/scripts/e.lua +++ b/client/scripts/e.lua @@ -49,7 +49,7 @@ function main(args) if o == "w" then width = a end end - data = data or '01020304' + data = data or '01020304' width = width or 0 print( string.rep('-',60) ) @@ -58,8 +58,8 @@ function main(args) print('') print( ('%-20s| %-16s| %s'):format('Model','CRC', 'CRC reverse','bigEnd', 'bigEnd','little','little')) print( string.rep('-',60) ) - local lists = core.reveng_models(width) - if lists == nil then return oops("Couldn't find any CRC algos with that width") end + local lists, err = core.reveng_models(width) + if lists == nil then return oops(err) end for _,i in pairs(lists) do if string.len(i) > 1 then