From 056e26b45e07b3aa32d68454588407a15be4991d Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 12 Apr 2009 05:38:35 +0000 Subject: Thanks to Christoph Mallon for pointing out the dead variable here. Also, rework this a little to make the logic excruciatingly clear. --- lib/libarchive/archive_read_support_format_empty.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/libarchive/archive_read_support_format_empty.c') diff --git a/lib/libarchive/archive_read_support_format_empty.c b/lib/libarchive/archive_read_support_format_empty.c index 38498cf7ff3dd..db24d9dae4d3c 100644 --- a/lib/libarchive/archive_read_support_format_empty.c +++ b/lib/libarchive/archive_read_support_format_empty.c @@ -59,13 +59,14 @@ 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; - h = __archive_read_ahead(a, 1, &avail); - if (avail != 0) - return (-1); - return (1); + (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); } static int -- cgit v1.3