public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf: Fix incorrect comparison in sort_priorities_by_name
@ 2020-12-09 18:23 Florian Weimer
  2020-12-09 18:29 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Weimer @ 2020-12-09 18:23 UTC (permalink / raw)
  To: libc-alpha

Reported-By: Stefan Liebler <stli@linux.ibm.com>

---
 elf/dl-hwcaps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
index 5a71f80154..000e3c0eb9 100644
--- a/elf/dl-hwcaps.c
+++ b/elf/dl-hwcaps.c
@@ -153,7 +153,7 @@ sort_priorities_by_name (void)
 	else
 	  to_compare = previous->name_length;
 	int cmp = memcmp (current->name, previous->name, to_compare);
-	if (cmp >= 0
+	if (cmp > 0
 	    || (cmp == 0 && current->name_length >= previous->name_length))
 	  break;
 

-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] elf: Fix incorrect comparison in sort_priorities_by_name
  2020-12-09 18:23 [PATCH] elf: Fix incorrect comparison in sort_priorities_by_name Florian Weimer
@ 2020-12-09 18:29 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2020-12-09 18:29 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

On Wed, Dec 9, 2020 at 10:24 AM Florian Weimer via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> Reported-By: Stefan Liebler <stli@linux.ibm.com>
>
> ---
>  elf/dl-hwcaps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/elf/dl-hwcaps.c b/elf/dl-hwcaps.c
> index 5a71f80154..000e3c0eb9 100644
> --- a/elf/dl-hwcaps.c
> +++ b/elf/dl-hwcaps.c
> @@ -153,7 +153,7 @@ sort_priorities_by_name (void)
>         else
>           to_compare = previous->name_length;
>         int cmp = memcmp (current->name, previous->name, to_compare);
> -       if (cmp >= 0
> +       if (cmp > 0
>             || (cmp == 0 && current->name_length >= previous->name_length))
>           break;
>
>

LGTM.

-- 
H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-09 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 18:23 [PATCH] elf: Fix incorrect comparison in sort_priorities_by_name Florian Weimer
2020-12-09 18:29 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).