On Tue, 10 Sep 2013, Junio C Hamano wrote:

> >       packv4-parse.c: allow tree entry copying from a canonical tree object
> 
> This one needed a small fix-up to make it compile.
> 
> I do not particularly like reusing that "size" variable, but it
> seemed to be dead at that point, so...
> 
>  packv4-parse.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/packv4-parse.c b/packv4-parse.c
> index f96acc1..3f95ed4 100644
> --- a/packv4-parse.c
> +++ b/packv4-parse.c
> @@ -365,13 +365,14 @@ static int copy_canonical_tree_entries(struct 
> packed_git *p, off_t offset,
>               update_tree_entry(&desc);
>       end = desc.buffer;
>  
> -     if (end - from > *sizep) {
> +     size = (const char *)end - (const char *)from;
> +     if (size > *sizep) {

BTW, a simpler fix might simply involve declaring those 2 variables as 
const char * up front which would remove the need for any cast.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to