diff options
author | peter <peter@FreeBSD.org> | 1999-01-10 09:47:00 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-01-10 09:47:00 +0000 |
commit | b66130e248e76492a053cf3cb3fe84f580668361 (patch) | |
tree | 3caf4fc6f883e76264c0a8d3c81387ebbb685ebf /lib/libz/inffast.c | |
parent | 9f86c0bf8cf1224d46bbefe1d308f2cc8186a79b (diff) | |
download | FreeBSD-src-b66130e248e76492a053cf3cb3fe84f580668361.zip FreeBSD-src-b66130e248e76492a053cf3cb3fe84f580668361.tar.gz |
Import zlib 1.1.3 onto the vendor branch.
Obtained from: ftp.cdrom.com:/pub/infozip/zlib
Diffstat (limited to 'lib/libz/inffast.c')
-rw-r--r-- | lib/libz/inffast.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libz/inffast.c b/lib/libz/inffast.c index 3c6ff06..61a78ee 100644 --- a/lib/libz/inffast.c +++ b/lib/libz/inffast.c @@ -13,14 +13,12 @@ struct inflate_codes_state {int dummy;}; /* for buggy compilers */ /* simplify the use of the inflate_huft type with some defines */ -#define base more.Base -#define next more.Next #define exop word.what.Exop #define bits word.what.Bits /* macros for bit input with no checking and for returning unused bytes */ #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} -#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;} +#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;} /* Called with number of bytes left to write in window at least 258 (the maximum string length) and number of input bytes available @@ -120,7 +118,10 @@ z_streamp z; break; } else if ((e & 64) == 0) - e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop; + { + t += t->base; + e = (t += ((uInt)b & inflate_mask[e]))->exop; + } else { z->msg = (char*)"invalid distance code"; @@ -133,7 +134,8 @@ z_streamp z; } if ((e & 64) == 0) { - if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0) + t += t->base; + if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) { DUMPBITS(t->bits) Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? |