* [PATCH] lomount: correct qsort compare function
@ 2011-08-22 21:15 Andreas Schwab
2011-08-23 10:22 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2011-08-22 21:15 UTC (permalink / raw)
To: util-linux
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."
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-23 10:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22 21:15 [PATCH] lomount: correct qsort compare function Andreas Schwab
2011-08-23 10:22 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox