diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2024-01-21 07:46:56 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2024-01-21 07:46:56 +0000 |
commit | 9feb36b97c47af5154417e9771de6ffa7c81c636 (patch) | |
tree | a1db4793cdd5f86ea55f130390895db8c67ae8ff /sys/lib | |
parent | db482c845b5352172a6a2e69afff3fb9239a5073 (diff) |
sync with userland
Diffstat (limited to 'sys/lib')
-rw-r--r-- | sys/lib/libz/deflate.c | 20 | ||||
-rw-r--r-- | sys/lib/libz/zconf.h | 8 |
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/lib/libz/deflate.c b/sys/lib/libz/deflate.c index cfd1f00c417..9b5593ff367 100644 --- a/sys/lib/libz/deflate.c +++ b/sys/lib/libz/deflate.c @@ -1552,13 +1552,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { */ local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { diff --git a/sys/lib/libz/zconf.h b/sys/lib/libz/zconf.h index 7bc5562f162..58cc93959a0 100644 --- a/sys/lib/libz/zconf.h +++ b/sys/lib/libz/zconf.h @@ -298,14 +298,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have |