Fix get_chunk() - dedup - deduplicating backup program HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 528b7c40c8b3dbcbce387f35f6de93e21f2860e0 DIR parent 8ed79b4311c4715717198c0e04dd06efb29be265 HTML Author: sin <sin@2f30.org> Date: Thu, 21 Feb 2019 13:52:54 +0000 Fix get_chunk() Diffstat: M chunker.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- DIR diff --git a/chunker.c b/chunker.c @@ -93,10 +93,13 @@ fill_chunker(struct chunker *chunker) uint8_t * get_chunk(struct chunker *chunker, size_t *chunk_size) { + uint8_t *bp; + assert(chunker->rpos <= chunker->wpos); + bp = &chunker->buf[chunker->rpos]; *chunk_size = get_chunk_size(chunker); chunker->rpos += *chunk_size; - return chunker->buf; + return bp; } void