From: Nathan Moinvaziri Date: Mon, 4 Jan 2021 05:34:57 +0000 (-0800) Subject: Improve check_match output to print hex values of mismatch characters and character... X-Git-Tag: v2.0.0-RC1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=692f4d9c483826f015e01ad7b11c4d22f46df936;p=thirdparty%2Fzlib-ng.git Improve check_match output to print hex values of mismatch characters and character index. --- diff --git a/deflate.c b/deflate.c index 0f03656b..0d1d80c7 100644 --- a/deflate.c +++ b/deflate.c @@ -1203,9 +1203,10 @@ void check_match(deflate_state *s, Pos start, Pos match, int length) { } /* check that the match is indeed a match */ if (memcmp(s->window + match, s->window + start, length) != EQUAL) { + int32_t i = 0; fprintf(stderr, " start %u, match %u, length %d\n", start, match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); + fprintf(stderr, " %03d: match [%02x] start [%02x]\n", i++, s->window[match++], s->window[start++]); } while (--length != 0); z_error("invalid match"); }