X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f5f95a38c40de63a22112a972d4a18e377257c44..b45b059a3dcfcf835a8925c23240a3a49311ca44:/match.c diff --git a/match.c b/match.c index 557226a6..37ba1a0c 100644 --- a/match.c +++ b/match.c @@ -153,9 +153,12 @@ static void hash_search(int f,struct sum_struct *s, last_i = -1; if (verbose > 2) - rprintf(FINFO,"hash search b=%d len=%.0f\n",s->n,(double)len); + rprintf(FINFO,"hash search b=%ld len=%.0f\n", + (long) s->n, (double)len); - k = MIN(len, s->n); + /* cast is to make s->n signed; it should always be reasonably + * small */ + k = MIN(len, (OFF_T) s->n); map = (schar *)map_ptr(buf,0,k); @@ -170,8 +173,8 @@ static void hash_search(int f,struct sum_struct *s, end = len + 1 - s->sums[s->count-1].len; if (verbose > 3) - rprintf(FINFO,"hash search s->n=%d len=%.0f count=%d\n", - s->n,(double)len,s->count); + rprintf(FINFO, "hash search s->n=%ld len=%.0f count=%ld\n", + (long) s->n, (double) len, (long) s->count); do { tag t = gettag2(s1,s2); @@ -275,6 +278,10 @@ static void hash_search(int f,struct sum_struct *s, * checksums from the generator, and transmit either literal or token * data. * + * Also calculates the MD4 checksum of the whole file, using the md + * accumulator. This is transmitted with the file as protection + * against corruption on the wire. + * * @param s Checksums received from the generator. If s->count == * 0, then there are actually no checksums for this file. *