summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2002-05-23 20:29:08 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2002-05-23 20:29:08 +0000
commitb2497a37edf71ea1a83936bf72e6f4424a483c55 (patch)
tree4da33c2ba022208fe963e30835e139dbd9a9a14f
parentbacb1265d36404fb695a6664b1b11d9b2c34c43d (diff)
Signed/unsigned int bug caused lp->d_npartitions to be set to zero.
Should fix disklabel warnings on disks with no data track. The old code was unnecessary complex too.
-rw-r--r--sys/scsi/cd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index c767d494c84..9538d3e3b35 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.60 2002/03/14 03:16:12 millert Exp $ */
+/* $OpenBSD: cd.c,v 1.61 2002/05/23 20:29:07 csapuntz Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -1302,7 +1302,7 @@ cdgetdisklabel(dev, cd, lp, clp, spoofonly)
if (i < MAXPARTITIONS)
bzero(&lp->d_partitions[i], sizeof(lp->d_partitions[i]));
- lp->d_npartitions = max(RAW_PART, i - 1) + 1;
+ lp->d_npartitions = max((RAW_PART + 1), i);
done:
if (toc)