diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index c25bebdd3..ed73a98cc 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -636,7 +636,7 @@ int CmdHFiClassELoad(const char *Cmd) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogDevice(WARNING, "error, when getting filesize"); fclose(f); return 1; @@ -729,7 +729,7 @@ int CmdHFiClassDecrypt(const char *Cmd) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogEx(WARNING, "error, when getting filesize"); fclose(f); return 2; @@ -1609,7 +1609,7 @@ int CmdHFiClassReadTagFile(const char *Cmd) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogEx(WARNING, "Error, when getting filesize"); fclose(f); return 1; @@ -1766,7 +1766,7 @@ static int loadKeys(char *filename) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogEx(WARNING, "Error, when getting filesize"); fclose(f); return 1; diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index f20665df6..45c67bcb3 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -2076,7 +2076,7 @@ int CmdHF14AMfURestore(const char *Cmd) { fseek(f, 0, SEEK_END); long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogEx(WARNING, "Error, when getting filesize"); fclose(f); return 1; diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index b1c3c3797..a930d3be5 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -645,7 +645,7 @@ int CmdSmartUpgrade(const char *Cmd) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogEx(WARNING, "error, when getting filesize"); fclose(f); return 1; @@ -676,7 +676,7 @@ int CmdSmartUpgrade(const char *Cmd) { fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize < 0) { PrintAndLogEx(FAILED, "Could not determine size of SHA-512 file"); fclose(f); free(dump); diff --git a/client/loclass/elite_crack.c b/client/loclass/elite_crack.c index 038d8e475..5a280e7c1 100644 --- a/client/loclass/elite_crack.c +++ b/client/loclass/elite_crack.c @@ -539,7 +539,7 @@ int bruteforceFile(const char *filename, uint16_t keytable[]) { long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogDevice(WARNING, "Error, when getting filesize"); fclose(f); return 1; diff --git a/client/loclass/fileutils.c b/client/loclass/fileutils.c index 4ac77633a..4bfe0129e 100644 --- a/client/loclass/fileutils.c +++ b/client/loclass/fileutils.c @@ -292,7 +292,7 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t m long fsize = ftell(f); fseek(f, 0, SEEK_SET); - if (fsize < 0) { + if (fsize <= 0) { PrintAndLogDevice(FAILED, "error, when getting filesize"); retval = 1; goto out;