Util-Linux package development
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: util-linux@vger.kernel.org
Subject: [PATCH] lomount: correct qsort compare function
Date: Mon, 22 Aug 2011 23:15:03 +0200	[thread overview]
Message-ID: <m2obzhywq0.fsf@igel.home> (raw)

Return the correct value from comparing the operands.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 mount/lomount.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mount/lomount.c b/mount/lomount.c
index 34d151a..fad58d5 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -285,7 +285,7 @@ name2minor(int hasprefix, const char *name)
 static int
 cmpnum(const void *p1, const void *p2)
 {
-	return (* (int *) p1) > (* (int *) p2);
+	return (*(int *) p1 > *(int *) p2) - (*(int *) p1 < *(int *) p2);
 }
 
 /*
-- 
1.7.6


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

             reply	other threads:[~2011-08-22 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 21:15 Andreas Schwab [this message]
2011-08-23 10:22 ` [PATCH] lomount: correct qsort compare function Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2obzhywq0.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox