Re: [PATCH 1/5] add SWAP macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 24, 2017 at 6:49 PM, Jeff King <peff@xxxxxxxx> wrote:
> diff --git a/prio-queue.c b/prio-queue.c
> index 17252d231..fc3860fdc 100644
> --- a/prio-queue.c
> +++ b/prio-queue.c
> @@ -21,7 +21,7 @@ void prio_queue_reverse(struct prio_queue *queue)
>
>         if (queue->compare != NULL)
>                 die("BUG: prio_queue_reverse() on non-LIFO queue");
> -       for (i = 0; i <= (j = (queue->nr - 1) - i); i++)
> +       for (i = 0; i < (j = (queue->nr - 1) - i); i++)
>                 swap(queue, i, j);
>  }

FWIW This shuts valgrind-3.10.1 up.
-- 
Duy



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]