--- libfdisk/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c index 26f526a..ab4709c 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c @@ -1012,7 +1012,7 @@ fdisk_sector_t fdisk_set_last_lba(struct fdisk_context *cxt, fdisk_sector_t lba) { assert(cxt); - if (lba > cxt->total_sectors - 1 && lba < 1) + if (lba > cxt->total_sectors - 1 || lba < 1) return -ERANGE; cxt->last_lba = lba; return 0; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html