From: Karel Zak Date: Mon, 8 Jun 2015 14:45:15 +0000 (+0200) Subject: libfdisk: (dos) fix tiny partitions calculation X-Git-Tag: v2.27-rc1~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09a4ca5e450c5e7cbe860453b76fd68c60fe591f;p=thirdparty%2Futil-linux.git libfdisk: (dos) fix tiny partitions calculation Signed-off-by: Karel Zak --- diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c index e5f7081327..53c7484bf9 100644 --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@ -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)); }