]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Improve check_match output to print hex values of mismatch characters and character...
authorNathan Moinvaziri <nathan@nathanm.com>
Mon, 4 Jan 2021 05:34:57 +0000 (21:34 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 5 Jan 2021 16:08:16 +0000 (17:08 +0100)
deflate.c

index 0f03656b3755943a135eeff1ad1c6e9b95c6f695..0d1d80c7d5555cc84521e07cab857c2502195b43 100644 (file)
--- 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");
     }