Matthew White <[email protected]> writes:

> diff --git a/src/main.c b/src/main.c
> index ac6ee2c..11ea86d 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -2136,10 +2136,11 @@ only if outputting to a regular file.\n"));
>                    for (mres_ptr = mfile->resources; *mres_ptr; mres_ptr++)
>                      mres_count++;
>  
> -                  stable_sort (mfile->resources,
> -                               mres_count,
> -                               sizeof (metalink_resource_t *),
> -                               metalink_res_cmp);
> +                  if (mres_count > 1)
> +                    stable_sort (mfile->resources,
> +                                 mres_count,
> +                                 sizeof (metalink_resource_t *),
> +                                 metalink_res_cmp);
>                  }
>              }
>            retr_err = retrieve_from_metalink (metalink);

hm.. actually stable_sort checks for size, but I think it should check
for nmemb.  Could you please fix stable_sort (utils.c) to do the right
thing and replace this patch with that?

Regards,
Giuseppe

Reply via email to