diff options
Diffstat (limited to 'usr.bin/compress')
| -rw-r--r-- | usr.bin/compress/Makefile | 1 | ||||
| -rw-r--r-- | usr.bin/compress/compress.c | 12 | ||||
| -rw-r--r-- | usr.bin/compress/zopen.c | 5 |
3 files changed, 6 insertions, 12 deletions
diff --git a/usr.bin/compress/Makefile b/usr.bin/compress/Makefile index 02f7fbbd88101..0f6f5ddab9ce0 100644 --- a/usr.bin/compress/Makefile +++ b/usr.bin/compress/Makefile @@ -1,7 +1,6 @@ # @(#)Makefile 8.2 (Berkeley) 4/17/94 PROG= compress -CFLAGS+=-Wall SRCS= compress.c zopen.c LINKS= ${BINDIR}/compress ${BINDIR}/uncompress MLINKS= compress.1 uncompress.1 diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c index e81963527cbd5..32d94960eb9de 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -32,13 +32,13 @@ */ #ifndef lint -static const char copyright[] = +static char copyright[] = "@(#) Copyright (c) 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static const char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; +static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #endif /* not lint */ #include <sys/param.h> @@ -80,7 +80,6 @@ main(argc, argv) int bits, cat, ch; char *p, newname[MAXPATHLEN]; - cat = 0; if ((p = rindex(argv[0], '/')) == NULL) p = argv[0]; else @@ -89,13 +88,10 @@ main(argc, argv) style = DECOMPRESS; else if (!strcmp(p, "compress")) style = COMPRESS; - else if (!strcmp(p, "zcat")) { - cat = 1; - style = DECOMPRESS; - } else + else errx(1, "unknown program name"); - bits = 0; + bits = cat = 0; while ((ch = getopt(argc, argv, "b:cdfv")) != -1) switch(ch) { case 'b': diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c index abe31f2de63f3..5e5357b74b9ed 100644 --- a/usr.bin/compress/zopen.c +++ b/usr.bin/compress/zopen.c @@ -388,7 +388,7 @@ output(zs, ocode) * Since ocode is always >= 8 bits, only need to mask the first * hunk on the left. */ - *bp = (*bp & rmask[r_off]) | ((ocode << r_off) & lmask[r_off]); + *bp = (*bp & rmask[r_off]) | (ocode << r_off) & lmask[r_off]; bp++; bits -= (8 - r_off); ocode >>= 8 - r_off; @@ -698,7 +698,7 @@ zopen(fname, mode, bits) { struct s_zstate *zs; - if ((mode[0] != 'r' && mode[0] != 'w') || mode[1] != '\0' || + if (mode[0] != 'r' && mode[0] != 'w' || mode[1] != '\0' || bits < 0 || bits > BITS) { errno = EINVAL; return (NULL); @@ -738,5 +738,4 @@ zopen(fname, mode, bits) return (funopen(zs, NULL, zwrite, NULL, zclose)); } /* NOTREACHED */ - return (NULL); } |
