Fix a bug in the size of the PMBR partition. Since the partition starts

at LBA 1, the size is not the mediasize in sectors, but one less.
This commit is contained in:
Marcel Moolenaar 2006-08-09 20:19:15 +00:00
parent c3b36c8f05
commit 97a337185f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161135

View File

@ -123,6 +123,8 @@ write_pmbr(int fd, const struct disk *disk)
error = 0;
nsects = disk->media_size / disk->sector_size;
nsects--; /* The GPT starts at LBA 1 */
buffer = calloc(disk->sector_size, 1);
if (buffer == NULL)
return (ENOMEM);