diff options
Diffstat (limited to 'usr.bin/compress')
-rw-r--r-- | usr.bin/compress/compress.c | 8 | ||||
-rw-r--r-- | usr.bin/compress/zopen.3 | 5 | ||||
-rw-r--r-- | usr.bin/compress/zopen.c | 10 |
3 files changed, 12 insertions, 11 deletions
diff --git a/usr.bin/compress/compress.c b/usr.bin/compress/compress.c index 0f48dcbaf42..c2bbc26fcc7 100644 --- a/usr.bin/compress/compress.c +++ b/usr.bin/compress/compress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.c,v 1.4 1997/01/17 07:12:29 millert Exp $ */ +/* $OpenBSD: compress.c,v 1.5 1997/01/19 17:25:11 millert Exp $ */ /* $NetBSD: compress.c,v 1.9 1995/03/26 09:44:38 glass Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #else -static char rcsid[] = "$OpenBSD: compress.c,v 1.4 1997/01/17 07:12:29 millert Exp $"; +static char rcsid[] = "$OpenBSD: compress.c,v 1.5 1997/01/19 17:25:11 millert Exp $"; #endif #endif /* not lint */ @@ -202,7 +202,7 @@ compress(in, out, bits) struct stat isb, sb; FILE *ifp, *ofp; int exists, isreg, oreg; - u_char buf[1024]; + u_char buf[BUFSIZ]; exists = !stat(out, &sb); if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) @@ -292,7 +292,7 @@ decompress(in, out, bits) struct stat sb; FILE *ifp, *ofp; int exists, isreg, oreg; - u_char buf[1024]; + u_char buf[BUFSIZ]; exists = !stat(out, &sb); if (!force && exists && S_ISREG(sb.st_mode) && !permission(out)) diff --git a/usr.bin/compress/zopen.3 b/usr.bin/compress/zopen.3 index a8f95941bf4..85650564f8e 100644 --- a/usr.bin/compress/zopen.3 +++ b/usr.bin/compress/zopen.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: zopen.3,v 1.3 1996/09/22 20:05:18 tholo Exp $ +.\" $OpenBSD: zopen.3,v 1.4 1997/01/19 17:25:12 millert Exp $ .\" $NetBSD: zopen.3,v 1.3 1995/03/26 09:44:49 glass Exp $ .\" .\" Copyright (c) 1992, 1993 @@ -142,7 +142,8 @@ or The .Nm zopen function -first appeared in 4.4BSD. +first appeared in +.Bx 4.4 . .Sh BUGS The .Fn zopen diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c index dcf742c78d1..d9c2afd7746 100644 --- a/usr.bin/compress/zopen.c +++ b/usr.bin/compress/zopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zopen.c,v 1.3 1996/09/22 20:05:19 tholo Exp $ */ +/* $OpenBSD: zopen.c,v 1.4 1997/01/19 17:25:14 millert Exp $ */ /* $NetBSD: zopen.c,v 1.5 1995/03/26 09:44:53 glass Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)zopen.c 8.1 (Berkeley) 6/27/93"; #else -static char rcsid[] = "$OpenBSD: zopen.c,v 1.3 1996/09/22 20:05:19 tholo Exp $"; +static char rcsid[] = "$OpenBSD: zopen.c,v 1.4 1997/01/19 17:25:14 millert Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -394,7 +394,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; @@ -705,7 +705,7 @@ zdopen(fd, 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); @@ -754,7 +754,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); |