summaryrefslogtreecommitdiff
path: root/bin/pax/ar_io.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-11-24 18:16:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-11-24 18:16:00 +0000
commit0304f9b293749a7c1fd03811229ee4baa82b8103 (patch)
treee69f160f6a10b34d22abeeb99d6a986c01c1b257 /bin/pax/ar_io.c
parentc30ed99b76bbed2502088e2128ada827e81ffd49 (diff)
Fix core dump if -xz and archive does not exist (doh!)
Diffstat (limited to 'bin/pax/ar_io.c')
-rw-r--r--bin/pax/ar_io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index 5dff4b18752..3573f7c021b 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar_io.c,v 1.6 1996/10/27 00:29:40 millert Exp $ */
+/* $OpenBSD: ar_io.c,v 1.7 1996/11/24 18:15:59 millert Exp $ */
/* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: ar_io.c,v 1.6 1996/10/27 00:29:40 millert Exp $";
+static char rcsid[] = "$OpenBSD: ar_io.c,v 1.7 1996/11/24 18:15:59 millert Exp $";
#endif
#endif /* not lint */
@@ -139,7 +139,7 @@ ar_open(name)
syswarn(0, errno, "Failed open to read on %s", name);
if (zflag == GZIP_CMP) {
gzf = gzdopen(arfd, "r");
- if (!gz_iszipped(gzf)) {
+ if (gzf && !gz_iszipped(gzf)) {
(void)lseek(arfd, 0, SEEK_SET);
zflag = COMPRESS_CMP;
}