--- src/gnu/usr.bin/gzip/Attic/inflate.c 2003/06/17 04:25:46 1.2 +++ src/gnu/usr.bin/gzip/Attic/inflate.c 2004/09/14 00:03:32 1.3 @@ -2,7 +2,7 @@ * version c10p1, 10 January 1993 * * $FreeBSD: src/gnu/usr.bin/gzip/inflate.c,v 1.8 1999/08/27 23:35:51 peter Exp $ - * $DragonFly: src/gnu/usr.bin/gzip/inflate.c,v 1.1 2003/06/16 04:09:20 dillon Exp $ + * $DragonFly$ */ /* You can do whatever you like with this source file, though I would @@ -360,6 +360,7 @@ int *m; /* maximum looku if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); + n = x[g]; /* Generate the Huffman codes and for each, make the table entries */ @@ -390,12 +391,13 @@ int *m; /* maximum looku { /* 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 */