added tests with null files, changed condition to check that the file is more than 0 bytes

This commit is contained in:
Paul Cruz
2017-06-20 14:33:08 -07:00
parent 58c19b4202
commit a73c2a444a
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -889,7 +889,7 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){
BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];
size_t const numBytesRead = fread(headerBuffer, 1, sizeof(headerBuffer), srcFile);
if (numBytesRead < ZSTD_frameHeaderSize_min) {
if (feof(srcFile) && numBytesRead == 0) {
if (feof(srcFile) && numBytesRead == 0 && info->compressedSize > 0) {
break;
}
else if (feof(srcFile)) {