diff options
Diffstat (limited to 'usr.bin/compress')
-rw-r--r-- | usr.bin/compress/Makefile | 1 | ||||
-rw-r--r-- | usr.bin/compress/compress.c | 4 | ||||
-rw-r--r-- | usr.bin/compress/zopen.c | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/compress/Makefile b/usr.bin/compress/Makefile index 0f6f5ddab9ce..02f7fbbd8810 100644 --- a/usr.bin/compress/Makefile +++ b/usr.bin/compress/Makefile @@ -1,6 +1,7 @@ # @(#)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 5e323d3bde13..e81963527cbd 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -32,13 +32,13 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; +static const char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #endif /* not lint */ #include <sys/param.h> diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c index 5e5357b74b9e..abe31f2de63f 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,4 +738,5 @@ zopen(fname, mode, bits) return (funopen(zs, NULL, zwrite, NULL, zclose)); } /* NOTREACHED */ + return (NULL); } |