Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions programs/dibio.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,15 @@ static fileStats DiB_fileStats(const char** fileNamesTable, int nbFiles, size_t
for (n=0; n<nbFiles; n++) {
S64 const fileSize = DiB_getFileSize(fileNamesTable[n]);
/* TODO: is there a minimum sample size? What if the file is 1-byte? */
if (fileSize == 0) {
DISPLAYLEVEL(3, "Sample file '%s' has zero size, skipping...\n", fileNamesTable[n]);
/* Skip empty or invalid files */
if (fileSize <= 0) {
if (fileSize < 0) {
DISPLAYLEVEL(3, "Sample file '%s' is unreadable or stat failed, skipping...\n",
fileNamesTable[n]);
} else {
DISPLAYLEVEL(3, "Sample file '%s' has zero size, skipping...\n",
fileNamesTable[n]);
}
continue;
}

Expand Down
Loading