fsize can't be zero
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user