summaryrefslogtreecommitdiff
path: root/sbin/fdisk
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-10-08 15:45:44 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-10-08 15:45:44 +0000
commit54765521579a7a7920bd46cac01fdd556b9a353a (patch)
tree8b8b531ecc39947e2b2c17f38b06db4a647f423d /sbin/fdisk
parentd423b14d219bdba6ee917447b5bff908182d89f4 (diff)
Keep disk sector calcuations in u_int64_t as long as possible, and
avoid using a daddr_t variable to hold a disk sector value even temporarily. No intentional functional change.
Diffstat (limited to 'sbin/fdisk')
-rw-r--r--sbin/fdisk/mbr.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/fdisk/mbr.c b/sbin/fdisk/mbr.c
index 264926b8125..b4ba5009a3a 100644
--- a/sbin/fdisk/mbr.c
+++ b/sbin/fdisk/mbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbr.c,v 1.30 2013/06/11 16:42:04 deraadt Exp $ */
+/* $OpenBSD: mbr.c,v 1.31 2013/10/08 15:45:43 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -48,7 +48,7 @@ void
MBR_init(disk_t *disk, mbr_t *mbr)
{
daddr_t i;
- int adj;
+ u_int64_t adj;
/* Fix up given mbr for this disk */
mbr->part[0].flag = 0;
@@ -100,8 +100,7 @@ MBR_init(disk_t *disk, mbr_t *mbr)
i = 1;
while (i < DL_SECTOBLK(&dl, mbr->part[3].bs))
i *= 2;
- i = DL_BLKTOSEC(&dl, i);
- adj = i - mbr->part[3].bs;
+ adj = DL_BLKTOSEC(&dl, i) - mbr->part[3].bs;
mbr->part[3].bs += adj;
mbr->part[3].ns -= adj;
PRT_fix_CHS(disk, &mbr->part[3]);