Commit 3f26945c authored by Wayne Davison's avatar Wayne Davison

Include backup in map_ptr() to avoid backing up when reading.

parent 580cffde
......@@ -257,7 +257,11 @@ static void hash_search(int f,struct sum_struct *s,
* in the sender's file, we'll output enough literal data
* to re-align with the basis file, and get back to seeking
* instead of writing. */
map = (schar *)map_ptr(buf, aligned_offset, l);
backup = (int32)(aligned_offset - last_match);
if (backup < 0)
backup = 0;
map = (schar *)map_ptr(buf, aligned_offset - backup, l + backup)
+ backup;
sum = get_checksum1((char *)map, l);
if (sum != s->sums[i2].sum1)
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment