summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-04-17 01:00:11 +0000
committerkientzle <kientzle@FreeBSD.org>2009-04-17 01:00:11 +0000
commit89890db5f1bc854480bafcdf319941de52ebbcdd (patch)
tree78c4f9b1da3f234ed8ca20bfbfcd901a4c541b05 /lib/libarchive
parent14086ec084cde031ddfc95eb2c794497255fbb4c (diff)
downloadFreeBSD-src-89890db5f1bc854480bafcdf319941de52ebbcdd.zip
FreeBSD-src-89890db5f1bc854480bafcdf319941de52ebbcdd.tar.gz
Don't match an empty file on a read error.
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read_support_format_empty.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libarchive/archive_read_support_format_empty.c b/lib/libarchive/archive_read_support_format_empty.c
index db24d9d..38498cf 100644
--- a/lib/libarchive/archive_read_support_format_empty.c
+++ b/lib/libarchive/archive_read_support_format_empty.c
@@ -59,14 +59,13 @@ archive_read_support_format_empty(struct archive *_a)
static int
archive_read_format_empty_bid(struct archive_read *a)
{
+ const void *h;
ssize_t avail;
- (void)__archive_read_ahead(a, 1, &avail);
- /* Bid 1 if we successfully read exactly zero bytes. */
- if (avail == 0)
- return (1);
- /* Otherwise, we don't bid on this. */
- return (-1);
+ h = __archive_read_ahead(a, 1, &avail);
+ if (avail != 0)
+ return (-1);
+ return (1);
}
static int
OpenPOWER on IntegriCloud