aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrazvydas Ignotas <[email protected]>2017-03-09 02:54:52 +0200
committerTimothy Arceri <[email protected]>2017-03-09 20:26:23 +1100
commit926bcacfd3f9025007455c026d44f810018cf787 (patch)
treed08a36a686f7aa0cebe16dcf8785f10c02b2493e
parentf81ede469910d80ef000f313e3388d65a6bd0afd (diff)
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 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/util/disk_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 31a93365825..5470688df32 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -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) {