mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fix: cppcheck negative compare w u32
This commit is contained in:
parent
a3ce88eaec
commit
c857cf49f3
1 changed files with 43 additions and 44 deletions
|
@ -303,7 +303,6 @@ static int l_GetFromFlashMem(lua_State *L) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The following params expected:
|
* @brief The following params expected:
|
||||||
* uint8_t *destfilename
|
* uint8_t *destfilename
|
||||||
|
@ -312,7 +311,10 @@ static int l_GetFromFlashMem(lua_State *L) {
|
||||||
*/
|
*/
|
||||||
static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
||||||
|
|
||||||
if (IfPm3Flash()) {
|
if (IfPm3Flash() == false) {
|
||||||
|
return returnToLuaWithError(L, "No FLASH MEM support");
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t start_index = 0, len = 0x40000; //FLASH_MEM_MAX_SIZE
|
uint32_t start_index = 0, len = 0x40000; //FLASH_MEM_MAX_SIZE
|
||||||
char destfilename[32] = {0};
|
char destfilename[32] = {0};
|
||||||
size_t size;
|
size_t size;
|
||||||
|
@ -338,7 +340,7 @@ static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
||||||
|
|
||||||
len = resp.oldarg[0];
|
len = resp.oldarg[0];
|
||||||
|
|
||||||
if (len <= 0)
|
if (len == 0)
|
||||||
return returnToLuaWithError(L, "Filename invalid or empty");
|
return returnToLuaWithError(L, "Filename invalid or empty");
|
||||||
|
|
||||||
uint8_t *data = calloc(len, sizeof(uint8_t));
|
uint8_t *data = calloc(len, sizeof(uint8_t));
|
||||||
|
@ -354,9 +356,6 @@ static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
||||||
lua_pushunsigned(L, len);
|
lua_pushunsigned(L, len);
|
||||||
free(data);
|
free(data);
|
||||||
return 2;
|
return 2;
|
||||||
} else {
|
|
||||||
return returnToLuaWithError(L, "No FLASH MEM support");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue