MCPcopy Create free account
hub / github.com/RsyncProject/rsync / check_match

Function check_match

zlib/deflate.c:1344–1360  ·  view source on GitHub ↗

=========================================================================== * Check that the match at match_start is indeed a match. */

Source from the content-addressed store, hash-verified

1342 * Check that the match at match_start is indeed a match.
1343 */
1344local void check_match(deflate_state *s, IPos start, IPos match, int length)
1345{
1346 /* check that the match is indeed a match */
1347 if (zmemcmp(s->window + match,
1348 s->window + start, length) != EQUAL) {
1349 fprintf(stderr, " start %u, match %u, length %d\n",
1350 start, match, length);
1351 do {
1352 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1353 } while (--length != 0);
1354 z_error("invalid match");
1355 }
1356 if (z_verbose > 1) {
1357 fprintf(stderr,"\\[%d,%d]", start-match, length);
1358 do { putc(s->window[start++], stderr); } while (--length != 0);
1359 }
1360}
1361#else
1362# define check_match(s, start, match, length)
1363#endif /* DEBUG */

Callers 3

deflate_fastFunction · 0.85
deflate_slowFunction · 0.85
deflate_rleFunction · 0.85

Calls 1

zmemcmpFunction · 0.85

Tested by

no test coverage detected