summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xdelta3/xdelta3-merge.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/xdelta3/xdelta3-merge.h b/xdelta3/xdelta3-merge.h
index d917ba5..abc7c54 100644
--- a/xdelta3/xdelta3-merge.h
+++ b/xdelta3/xdelta3-merge.h
@@ -405,11 +405,11 @@ xd3_merge_source_copy (xd3_stream *stream,
405 405
406 sinst = &source->inst[sinst_num]; 406 sinst = &source->inst[sinst_num];
407 407
408 XD3_ASSERT (sinst->position >= iinst.addr); 408 XD3_ASSERT (iinst.addr >= sinst->position);
409 409
410 sinst_offset = sinst->position - iinst.addr; 410 sinst_offset = iinst.addr - sinst->position;
411 411
412 XD3_ASSERT (sinst->size > (sinst->position - iinst.addr)); 412 XD3_ASSERT (sinst->size > sinst_offset);
413 413
414 sinst_left = sinst->size - sinst_offset; 414 sinst_left = sinst->size - sinst_offset;
415 this_take = min (iinst.size, sinst_left); 415 this_take = min (iinst.size, sinst_left);