Correct the usage of the maxmaxcode so that compress -b 12 works again.

Thanks to Dave Rivers for reporting that problem.
This commit is contained in:
ats 1995-01-02 10:04:02 +00:00
parent 8e024c3b91
commit 1e1f81d37c

View File

@ -254,7 +254,7 @@ zwrite(cookie, wbp, num)
goto middle;
state = S_MIDDLE;
maxmaxcode = 1L << BITS;
maxmaxcode = 1L << maxbits;
if (fwrite(magic_header,
sizeof(char), sizeof(magic_header), fp) != sizeof(magic_header))
return (-1);
@ -707,7 +707,7 @@ zopen(fname, mode, bits)
return (NULL);
maxbits = bits ? bits : BITS; /* User settable max # bits/code. */
maxmaxcode = 1 << BITS; /* Should NEVER generate this code. */
maxmaxcode = 1L << maxbits; /* Should NEVER generate this code. */
hsize = HSIZE; /* For dynamic table sizing. */
free_ent = 0; /* First unused entry. */
block_compress = BLOCK_MASK;