diff --git a/programs/fileio.c b/programs/fileio.c index 7da7baaff..cbd7b92bc 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1298,8 +1298,8 @@ FIO_compressFilename_srcFile(FIO_prefs_t* const prefs, return 1; } - /* ensure src is not the same as dict */ - if (UTIL_isSameFile(srcFileName, ress.dictFileName)) { + /* ensure src is not the same as dict (if present) */ + if (ress.dictFileName != NULL && UTIL_isSameFile(srcFileName, ress.dictFileName)) { DISPLAYLEVEL(1, "zstd: cannot use %s as an input file and dictionary \n", srcFileName); return 1; }