summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/loopdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index fa3ad4560..81b7d2d6e 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -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)));
}
/*