mirror of
https://github.com/facebook/zstd.git
synced 2025-12-05 00:03:19 -05:00
Use one strstr() call instead of chain of strcmp()
This commit is contained in:
parent
7d9cd22e21
commit
a101721f4e
@ -2193,18 +2193,7 @@ FIO_determineDstName(const char* srcFileName)
|
|||||||
|
|
||||||
/* check suffix is authorized */
|
/* check suffix is authorized */
|
||||||
if (sfnSize <= suffixSize
|
if (sfnSize <= suffixSize
|
||||||
|| ( strcmp(suffixPtr, ZSTD_EXTENSION)
|
|| (strstr(SUFFIX_LIST, suffixPtr) == NULL)) {
|
||||||
#ifdef ZSTD_GZDECOMPRESS
|
|
||||||
&& strcmp(suffixPtr, GZ_EXTENSION)
|
|
||||||
#endif
|
|
||||||
#ifdef ZSTD_LZMADECOMPRESS
|
|
||||||
&& strcmp(suffixPtr, XZ_EXTENSION)
|
|
||||||
&& strcmp(suffixPtr, LZMA_EXTENSION)
|
|
||||||
#endif
|
|
||||||
#ifdef ZSTD_LZ4DECOMPRESS
|
|
||||||
&& strcmp(suffixPtr, LZ4_EXTENSION)
|
|
||||||
#endif
|
|
||||||
) ) {
|
|
||||||
DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s expected). Can't derive the output file name so specify it with -o dstFileName. -- ignored \n",
|
DISPLAYLEVEL(1, "zstd: %s: unknown suffix (%s expected). Can't derive the output file name so specify it with -o dstFileName. -- ignored \n",
|
||||||
srcFileName, SUFFIX_LIST);
|
srcFileName, SUFFIX_LIST);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user