summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/gzip/unlzw.c
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1993-10-14 00:33:38 +0000
committernate <nate@FreeBSD.org>1993-10-14 00:33:38 +0000
commiteb837699da243caa78b6b6ddf8065c8f6eb8a2e8 (patch)
tree4fbeb313da94b4852b82e5b0448d45f2e7ae41e9 /gnu/usr.bin/gzip/unlzw.c
parentf2586b2d69a4cd1077f15d406ee9c5e345ac3b8d (diff)
downloadFreeBSD-src-eb837699da243caa78b6b6ddf8065c8f6eb8a2e8.zip
FreeBSD-src-eb837699da243caa78b6b6ddf8065c8f6eb8a2e8.tar.gz
Updated gzip from version 1.2.2 to 1.2.4 due to popular demand
Diffstat (limited to 'gnu/usr.bin/gzip/unlzw.c')
-rw-r--r--gnu/usr.bin/gzip/unlzw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gnu/usr.bin/gzip/unlzw.c b/gnu/usr.bin/gzip/unlzw.c
index 61c45fc..15d2a31 100644
--- a/gnu/usr.bin/gzip/unlzw.c
+++ b/gnu/usr.bin/gzip/unlzw.c
@@ -7,7 +7,7 @@
* to accommodate in-memory decompression.
*/
-#ifndef lint
+#ifdef RCSID
static char rcsid[] = "$Id: unlzw.c,v 0.15 1993/06/10 13:28:35 jloup Exp $";
#endif
@@ -281,8 +281,10 @@ int unlzw(in, out)
goto resetbuf;
}
input(inbuf,posbits,code,n_bits,bitmask);
-
+ Tracev((stderr, "%d ", code));
+
if (oldcode == -1) {
+ if (code >= 256) error("corrupt input.");
outbuf[outpos++] = (char_type)(finchar = (int)(oldcode=code));
continue;
}
@@ -316,7 +318,8 @@ int unlzw(in, out)
write_buf(out, (char*)outbuf, outpos);
bytes_out += (ulg)outpos;
}
- error("corrupt input. Use zcat to recover some data.");
+ error(to_stdout ? "corrupt input." :
+ "corrupt input. Use zcat to recover some data.");
}
*--stackp = (char_type)finchar;
code = oldcode;
OpenPOWER on IntegriCloud