diff options
author | Karel Zak | 2014-12-04 13:06:03 +0100 |
---|---|---|
committer | Karel Zak | 2014-12-04 13:06:03 +0100 |
commit | 764b697c56660d3d7207b985ff6b0730df387954 (patch) | |
tree | 5d84b3f1204730c9f299f046eb87df215cc264e5 /libfdisk/src/partition.c | |
parent | libfdisk: remove 'end' from struct fdisk_partition (diff) | |
download | kernel-qcow2-util-linux-764b697c56660d3d7207b985ff6b0730df387954.tar.gz kernel-qcow2-util-linux-764b697c56660d3d7207b985ff6b0730df387954.tar.xz kernel-qcow2-util-linux-764b697c56660d3d7207b985ff6b0730df387954.zip |
libfdisk: fix bug in cmp_numbers() and partitions sorting
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1170191
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/partition.c')
-rw-r--r-- | libfdisk/src/partition.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 8ebdb4682..8f8402716 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -179,14 +179,14 @@ int fdisk_partition_has_start(struct fdisk_partition *pa) int fdisk_partition_cmp_start(struct fdisk_partition *a, struct fdisk_partition *b) { - int is_a = FDISK_IS_UNDEF(a->start), - is_b = FDISK_IS_UNDEF(b->start); + int no_a = FDISK_IS_UNDEF(a->start), + no_b = FDISK_IS_UNDEF(b->start); - if (!is_a && !is_b) + if (no_a && no_b) return 0; - if (!is_a) + if (no_a) return -1; - if (!is_b) + if (no_b) return 1; return cmp_numbers(a->start, b->start); |