summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/buffers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index e344b1e584..e3e3ab21b7 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1305,7 +1305,7 @@ write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
if (next < buf->cur)
old_avail = avail = buf->cur - next;
else
- old_avail = avail = (buf->mem + buf->datalen) - buf->cur;
+ old_avail = avail = (buf->mem + buf->datalen) - next;
switch (tor_zlib_process(state, &next, &avail, &data, &data_len, done)) {
case TOR_ZLIB_DONE:
over = 1;