Fix a really stupid bug where I assumed sizeof(int) == 2. This resulted in

MBR's with a 4th slice failing the signature check and fdisk saying that
they are invalid.

Submitted by:	bde
This commit is contained in:
John Baldwin 2000-07-21 18:26:20 +00:00
parent 0ce76c7dd0
commit fe81981fdb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63729
2 changed files with 2 additions and 2 deletions

View File

@ -794,7 +794,7 @@ read_s0()
warnx("can't read fdisk partition table");
return -1;
}
if (*(int *)&mboot.bootinst[MBRSIGOFF] != BOOT_MAGIC) {
if (*(uint16_t *)&mboot.bootinst[MBRSIGOFF] != BOOT_MAGIC) {
warnx("invalid fdisk partition table found");
/* So should we initialize things */
return -1;

View File

@ -794,7 +794,7 @@ read_s0()
warnx("can't read fdisk partition table");
return -1;
}
if (*(int *)&mboot.bootinst[MBRSIGOFF] != BOOT_MAGIC) {
if (*(uint16_t *)&mboot.bootinst[MBRSIGOFF] != BOOT_MAGIC) {
warnx("invalid fdisk partition table found");
/* So should we initialize things */
return -1;