util/disk_cache: fix compressed size calculation
It incorrectly doubles the size on each iteration.
Fixes: 85a9b1b5
"util/disk_cache: compress individual cache entries"
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:

committed by
Timothy Arceri

parent
f81ede4699
commit
926bcacfd3
@@ -696,7 +696,7 @@ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
|
||||
assert(ret != Z_STREAM_ERROR); /* state not clobbered */
|
||||
|
||||
size_t have = BUFSIZE - strm.avail_out;
|
||||
compressed_size += compressed_size + have;
|
||||
compressed_size += have;
|
||||
|
||||
size_t written = 0;
|
||||
for (size_t len = 0; len < have; len += written) {
|
||||
|
Reference in New Issue
Block a user