From: Tim Kientzle Date: Mon, 15 Jun 2009 06:19:38 +0000 (-0400) Subject: Compare 'avail' to 0, not ARCHIVE_OK. (A zero value here X-Git-Tag: v2.8.0~580 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dea326fd3c0fcbe716c2f614211f5ab88d1278c3;p=thirdparty%2Flibarchive.git Compare 'avail' to 0, not ARCHIVE_OK. (A zero value here represents the number of bytes available, not a success status.) SVN-Revision: 1169 --- diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index c211dd1bc..858f8ee07 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -384,7 +384,8 @@ build_stream(struct archive_read *a) } /* Verify the filter by asking it for some data. */ __archive_read_filter_ahead(filter, 1, &avail); - if (avail < ARCHIVE_OK) { + if (avail < 0) { + /* If the read failed, bail out now. */ free(filter); return (avail); }