mkimg: Correct an off by one error in the PMBR size

The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec
2.6 page 118 table 17).
This fixes warning printed by linux tools like parted or fdisk.

Sponsored by:	Gandi.net
This commit is contained in:
Emmanuel Vadot 2017-05-29 12:51:02 +00:00
parent 7f1f65918b
commit 6b14aecae7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319125

View File

@ -152,7 +152,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode)
uint32_t secs;
int error;
secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks;
secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1;
pmbr = malloc(secsz);
if (pmbr == NULL)