Skip to content
Commit 1e3d9c1e authored by Bruno Haible's avatar Bruno Haible Committed by Adhemerval Zanella
Browse files

argp: Avoid undefined behaviour when invoking qsort().

This fixes a Gnulib test-argp-2.sh test failure on macOS and FreeBSD.

Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00085.html

>.

* argp/argp-help.c (group_cmp): Remove third argument.
(hol_sibling_cluster_cmp, hol_cousin_cluster_cmp): New functions, based
upon hol_cluster_cmp.
(hol_cluster_cmp): Use hol_cousin_cluster_cmp.
(hol_entry_cmp): Rewritten to implement a total order.

Reviewed-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
parent bbf15241
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment