diff --git a/client/cmdflashmem.c b/client/cmdflashmem.c index 0fb25fad9..ce5b37f44 100644 --- a/client/cmdflashmem.c +++ b/client/cmdflashmem.c @@ -209,7 +209,7 @@ static int CmdFlashMemLoad(const char *Cmd) { datalen += 2; break; case DICTIONARY_NONE: - res = loadFile_safe(filename, ".bin", (void**)&data, &datalen); + res = loadFile_safe(filename, ".bin", (void **)&data, &datalen); if (res != PM3_SUCCESS) { free(data); return PM3_EFILE; diff --git a/client/cmdflashmemspiffs.c b/client/cmdflashmemspiffs.c index 0eef78259..109f51ae1 100644 --- a/client/cmdflashmemspiffs.c +++ b/client/cmdflashmemspiffs.c @@ -355,13 +355,13 @@ static int CmdFlashMemSpiFFSLoad(const char *Cmd) { size_t datalen = 0; uint8_t *data = NULL; - int res = loadFile_safe(filename, "", (void**)&data, &datalen); + int res = loadFile_safe(filename, "", (void **)&data, &datalen); // int res = loadFileEML( filename, data, &datalen); if (res != PM3_SUCCESS) { free(data); return PM3_EFILE; } - + // We want to mount before multiple operation so the lazy writes/append will not // trigger a mount + umount each loop iteration (lazy ops device side) SendCommandNG(CMD_SPIFFS_MOUNT, NULL, 0); diff --git a/client/scripting.c b/client/scripting.c index 33e7c6c42..724f72235 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -1059,20 +1059,20 @@ static int l_searchfile(lua_State *L) { if (n != 2) { return returnToLuaWithError(L, "Only filename and extension"); } - + size_t size; - // data + // data const char *filename = luaL_checklstring(L, 1, &size); - if ( size == 0 ) + if (size == 0) return returnToLuaWithError(L, "Must specify filename"); - - const char *suffix = luaL_checklstring(L, 2, &size); + + const char *suffix = luaL_checklstring(L, 2, &size); char *path; int res = searchFile(&path, "", filename, suffix, false); - if ( res != PM3_SUCCESS) { + if (res != PM3_SUCCESS) { return returnToLuaWithError(L, "Failed to find file"); } - + lua_pushstring(L, path); return 1; }