1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Thanks to Christoph Mallon for pointing out the dead variable here.

Also, rework this a little to make the logic excruciatingly clear.
This commit is contained in:
Tim Kientzle 2009-04-12 05:38:35 +00:00
parent e2421f7667
commit 056e26b45e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190960

View File

@ -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