]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (dos) fix tiny partitions calculation
authorKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2015 14:45:15 +0000 (16:45 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2015 14:45:15 +0000 (16:45 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c

index e5f70813270a64b18da14ad0774122d797f48a01..53c7484bf91fa1f35ee41f069b8e29f511f2587a 100644 (file)
@@ -1204,6 +1204,8 @@ static int add_partition(struct fdisk_context *cxt, size_t n,
                /* Don't try to be smart on very small partitions and don't
                 * align so small sizes, just follow the resurst */
                isrel = 0;
+               if (stop > start)
+                       stop -= 1;
                DBG(LABEL, ul_debug("DOS: don't align end os tiny partition [start=%ju, stop=%ju, grain=%lu]",
                           start, stop, cxt->grain));
        }