aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-08-16 09:03:34 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-08-16 09:03:34 +0000
commit16af5718b8718c662a9aa3f80945baf057288fff (patch)
treeb0beb95151464561b3ec5038d044fb3850211272 /gnu
parentbebabf44536401f0a6c7ad942e20953122791ab4 (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gzip/inflate.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gnu/usr.bin/gzip/inflate.c b/gnu/usr.bin/gzip/inflate.c
index c9b250b3bd61..82b15704254a 100644
--- a/gnu/usr.bin/gzip/inflate.c
+++ b/gnu/usr.bin/gzip/inflate.c
@@ -360,6 +360,7 @@ int *m; /* maximum lookup bits, returns actual */
if ((j = *p++) != 0)
v[x[j]++] = i;
} while (++i < n);
+ n = x[g]; /* set n to length of v */
/* Generate the Huffman codes and for each, make the table entries */
@@ -390,12 +391,13 @@ int *m; /* maximum lookup bits, returns actual */
{ /* too few codes for k-w bit table */
f -= a + 1; /* deduct codes from patterns left */
xp = c + k;
- while (++j < z) /* try smaller tables up to z bits */
- {
- if ((f <<= 1) <= *++xp)
- break; /* enough codes to use up j bits */
- f -= *xp; /* else deduct codes from patterns */
- }
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
}
z = 1 << j; /* table entries for j-bit table */