diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index c6abef32..5719c8cb 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2497,7 +2497,6 @@ static void ZSTD_copyBlockSequences(ZSTD_CCtx* zc) ZSTD_Sequence* outSeqs = &zc->seqCollector.seqStart[zc->seqCollector.seqIndex]; size_t i; - int repIdx; U32 rep[ZSTD_REP_NUM]; U32 shouldUpdateRep; @@ -2561,8 +2560,9 @@ static void ZSTD_copyBlockSequences(ZSTD_CCtx* zc) } outSeqs[i].offset = rawOffset; if (shouldUpdateRep) { - for (int i = ZSTD_REP_NUM - 1; i > 0; i--) { - rep[i] = rep[i - 1]; + int j; + for (j = ZSTD_REP_NUM - 1; j > 0; j--) { + rep[j] = rep[j - 1]; } rep[0] = outSeqs[i].offset; } diff --git a/tests/fuzzer.c b/tests/fuzzer.c index 65e44209..3a3fb6a1 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -2723,7 +2723,7 @@ static int basicUnitTests(U32 const seed, double compressibility) assert(cctx != NULL); /* Populate src with random data */ - RDG_genBuffer(CNBuffer, srcSize, compressibility, 0., seed); + RDG_genBuffer(CNBuffer, srcSize, compressibility, 0.5, seed); /* Test with block delimiters roundtrip */ seqsSize = ZSTD_generateSequences(cctx, seqs, srcSize, src, srcSize);