]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: [loopdev.c] correct qsort compare function
authorKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2011 10:01:12 +0000 (12:01 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2011 10:01:12 +0000 (12:01 +0200)
Reported-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/loopdev.c

index fa3ad456011628818f60a6edc8c44f37d2d3092e..81b7d2d6ec7cf38efa29ea3caee412712bd9857e 100644 (file)
@@ -309,7 +309,8 @@ static int loopiter_set_device(struct loopdev_cxt *lc, const char *device)
 
 static int cmpnum(const void *p1, const void *p2)
 {
-       return (* (int *) p1) > (* (int *) p2);
+       return (((* (int *) p1) > (* (int *) p2)) -
+                       ((* (int *) p1) < (* (int *) p2)));
 }
 
 /*