From 3c55d914df767a5fa2dd52feb4e8cc5ce604ea2a Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 22 Aug 2011 23:15:03 +0200 Subject: [PATCH] losetup: correct qsort compare function Return the correct value from comparing the operands. Signed-off-by: Andreas Schwab --- mount/lomount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mount/lomount.c b/mount/lomount.c index 34d151ac14..fad58d57f9 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); } /* -- 2.47.3