mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-30 19:40:37 -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:
|
||||
* uint8_t *destfilename
|
||||
|
@ -312,7 +311,10 @@ static int l_GetFromFlashMem(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
|
||||
char destfilename[32] = {0};
|
||||
size_t size;
|
||||
|
@ -338,7 +340,7 @@ static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
|||
|
||||
len = resp.oldarg[0];
|
||||
|
||||
if (len <= 0)
|
||||
if (len == 0)
|
||||
return returnToLuaWithError(L, "Filename invalid or empty");
|
||||
|
||||
uint8_t *data = calloc(len, sizeof(uint8_t));
|
||||
|
@ -354,9 +356,6 @@ static int l_GetFromFlashMemSpiffs(lua_State *L) {
|
|||
lua_pushunsigned(L, len);
|
||||
free(data);
|
||||
return 2;
|
||||
} else {
|
||||
return returnToLuaWithError(L, "No FLASH MEM support");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue