Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Apr 2009 16:13:21 +0200
From:      Christoph Mallon <christoph.mallon@gmx.de>
To:        Tim Kientzle <kientzle@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r191177 - head/lib/libarchive
Message-ID:  <49F31A81.8020909@gmx.de>
In-Reply-To: <200904170100.n3H10BQX099580@svn.freebsd.org>
References:  <200904170100.n3H10BQX099580@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Kientzle schrieb:
> Author: kientzle
> Date: Fri Apr 17 01:00:11 2009
> New Revision: 191177
> URL: http://svn.freebsd.org/changeset/base/191177
> 
> Log:
>   Don't match an empty file on a read error.
> 
> Modified:
>   head/lib/libarchive/archive_read_support_format_empty.c
> 
> Modified: head/lib/libarchive/archive_read_support_format_empty.c
> ==============================================================================
> --- head/lib/libarchive/archive_read_support_format_empty.c	Fri Apr 17 00:59:34 2009	(r191176)
> +++ head/lib/libarchive/archive_read_support_format_empty.c	Fri Apr 17 01:00:11 2009	(r191177)
> @@ -59,14 +59,13 @@ archive_read_support_format_empty(struct
>  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

The added variable "h" is write-only - should it get tested after the call?

	Christoph



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49F31A81.8020909>