summaryrefslogtreecommitdiffstats
path: root/sbin/fdisk
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-07-21 18:26:20 +0000
committerjhb <jhb@FreeBSD.org>2000-07-21 18:26:20 +0000
commit02577b66359fd932511fde36508eb7da55a09746 (patch)
tree434946f5809159fd790bdd7be9a5e3c952bd7dfb /sbin/fdisk
parent4b5414bf8369baa394fef53f0e5c72d5ea1d1d24 (diff)
downloadFreeBSD-src-02577b66359fd932511fde36508eb7da55a09746.zip
FreeBSD-src-02577b66359fd932511fde36508eb7da55a09746.tar.gz
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
Diffstat (limited to 'sbin/fdisk')
-rw-r--r--sbin/fdisk/fdisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 723db8d..ae339aa 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;
OpenPOWER on IntegriCloud