]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: make sure we check for maximal number of partitions
authorKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2020 10:58:42 +0000 (12:58 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2020 10:58:42 +0000 (12:58 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1018
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c

index 5e8ad178ebc24bf1ee80efbcbf24ed037bf856f8..79a55528dfd6967301a5980450e33d8b5adca115 100644 (file)
@@ -1756,8 +1756,8 @@ static int dos_add_partition(struct fdisk_context *cxt,
        if (last + grain < cxt->total_sectors - 1)
                free_sectors = 1;
 
-       if (!free_primary && cxt->label->nparts_max >= MAXIMUM_PARTS) {
-               fdisk_info(cxt, _("The maximum number of partitions has "
+       if (cxt->label->nparts_max >= MAXIMUM_PARTS) {
+               fdisk_warnx(cxt, _("The maximum number of partitions has "
                                  "been created."));
                return -EINVAL;
        }