From 5729115659a1f000cee8e9c0204322c9d03bca1b Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sun, 18 Dec 2005 03:42:24 +0000 Subject: Fix condition so "BIOS fixup botch" can, unlikely as it is, be detected. Found by lint. ok millert@ --- sbin/fdisk/disk.c | 8 ++++---- 1 file 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; } -- cgit v1.2.3