]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: correct qsort compare function
authorAndreas Schwab <schwab@linux-m68k.org>
Mon, 22 Aug 2011 21:15:03 +0000 (23:15 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2011 09:58:44 +0000 (11:58 +0200)
Return the correct value from comparing the operands.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
mount/lomount.c

index 34d151ac14db6f2b8190cc02ab7755d02285ce75..fad58d57f9753700b0e8561e3dfcd9e15db42e4e 100644 (file)
@@ -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);
 }
 
 /*