1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-07 01:10:04 +02:00

fixbug CLI's -D fails when the argument is not a regular file

This commit is contained in:
15596858998 2021-12-01 21:47:35 +08:00
parent 9ba07907c8
commit a8adfa7f67

View File

@ -742,6 +742,8 @@ static size_t FIO_createDictBuffer(void** bufferPtr, const char* fileName, FIO_p
if (fileHandle==NULL) EXM_THROW(31, "%s: %s", fileName, strerror(errno));
fileSize = UTIL_getFileSize(fileName);
if (fileSize == UTIL_FILESIZE_UNKNOWN)
EXM_THROW(32, "This file format is not supported : Dictionary file %s\n", fileName);
{
size_t const dictSizeMax = prefs->patchFromMode ? prefs->memLimit : DICTSIZE_MAX;
if (fileSize > dictSizeMax) {