summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-12-18 03:42:24 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-12-18 03:42:24 +0000
commit5729115659a1f000cee8e9c0204322c9d03bca1b (patch)
treeb2ac544cb6db57c8de746f9286f031b7190a4b22
parent00fa3f1558a820ee31de204f6c5fd5a5acf6584d (diff)
Fix condition so "BIOS fixup botch" can, unlikely as it is, be
detected. Found by lint. ok millert@
-rw-r--r--sbin/fdisk/disk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fdisk/disk.c b/sbin/fdisk/disk.c
index 5bd85cc6bb0..25b03a6e959 100644
--- a/sbin/fdisk/disk.c
+++ b/sbin/fdisk/disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.c,v 1.23 2005/11/21 01:59:24 krw Exp $ */
+/* $OpenBSD: disk.c,v 1.24 2005/12/18 03:42:23 krw Exp $ */
/*
* Copyright (c) 1997, 2001 Tobias Weingartner
@@ -198,9 +198,9 @@ DISK_getmetrics(disk_t *disk, DISK_metrics *user)
cyls = disk->label->size / (disk->bios->heads * disk->bios->sectors);
secs = cyls * (disk->bios->heads * disk->bios->sectors);
- if ((disk->label->size - secs) < 0)
- errx(1, "BIOS fixup botch (%d sectors)",
- disk->label->size - secs);
+ if (secs > disk->label->size)
+ errx(1, "BIOS fixup botch (secs (%d) > size (%d))",
+ secs, disk->label->size);
disk->bios->cylinders = cyls;
disk->bios->size = secs;
}