summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-12 23:56:22 (GMT)
committerYann Collet <cyan@fb.com>2019-04-12 23:56:22 (GMT)
commitdd43b913a292e5404aa8bc981ad11223f216d898 (patch)
treee0f610a7fcaaa6941708124891912832f894e23e
parentf8b760503445610c43cad813fb3eda29bb3fc763 (diff)
downloadlz4-dd43b913a292e5404aa8bc981ad11223f216d898.zip
lz4-dd43b913a292e5404aa8bc981ad11223f216d898.tar.gz
lz4-dd43b913a292e5404aa8bc981ad11223f216d898.tar.bz2
fix minor visual warning
yet some overly cautious overflow risk flag, while it's actually impossible, due to previous test just one line above. Changing the cast position, just to be please the thing.
-rw-r--r--lib/lz4hc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index a6dc7a2..4e3573a 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -458,7 +458,7 @@ LZ4_FORCE_INLINE int LZ4HC_encodeSequence (
/* Encode MatchLength */
assert(matchLength >= MINMATCH);
- length = (size_t)(matchLength - MINMATCH);
+ length = (size_t)matchLength - MINMATCH;
if ((limit) && (*op + (length / 255) + (1 + LASTLITERALS) > oend)) return 1; /* Check output limit */
if (length >= ML_MASK) {
*token += ML_MASK;
@@ -979,7 +979,7 @@ int LZ4_loadDictHC (LZ4_streamHC_t* LZ4_streamHCPtr,
DEBUGLOG(4, "LZ4_loadDictHC(%p, %p, %d)", LZ4_streamHCPtr, dictionary, dictSize);
assert(LZ4_streamHCPtr != NULL);
if (dictSize > 64 KB) {
- dictionary += dictSize - 64 KB;
+ dictionary += (size_t)dictSize - 64 KB;
dictSize = 64 KB;
}
/* need a full initialization, there are bad side-effects when using resetFast() */