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:
Andreas Schulz 1995-01-02 10:04:02 +00:00
parent 8abfb51a90
commit 5cf1ec501a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5342

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;