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:
parent
7f1f65918b
commit
6b14aecae7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319125
@ -152,7 +152,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode)
|
|||||||
uint32_t secs;
|
uint32_t secs;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks;
|
secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1;
|
||||||
|
|
||||||
pmbr = malloc(secsz);
|
pmbr = malloc(secsz);
|
||||||
if (pmbr == NULL)
|
if (pmbr == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user