diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 723db8d1d414..ae339aae840a 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -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; diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index 723db8d1d414..ae339aae840a 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -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;