]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
simple fix for using bit operator. 2541/head
authorihsinme <ihsinme@gmail.com>
Wed, 17 Mar 2021 08:37:42 +0000 (11:37 +0300)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 08:37:42 +0000 (11:37 +0300)
good day.
It seems to me that the developer intended to use a logical operator.
so I suggest a simple fix.

lib/compress/zstd_compress_literals.c

index 1d9188d330f8a4366c88978846df72ec43e37a59..9bb6085e695535ab391affc11f9f3067847b94d2 100644 (file)
@@ -117,7 +117,7 @@ size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf,
         }
     }
 
-    if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLitSize)) {
+    if ((cLitSize==0) || (cLitSize >= srcSize - minGain) || ERR_isError(cLitSize)) {
         ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
         return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
     }