summaryrefslogtreecommitdiff
path: root/sbin/fdisk/mbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fdisk/mbr.c')
-rw-r--r--sbin/fdisk/mbr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/fdisk/mbr.c b/sbin/fdisk/mbr.c
index 69479fdfda0..41e7478d5ef 100644
--- a/sbin/fdisk/mbr.c
+++ b/sbin/fdisk/mbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbr.c,v 1.73 2021/06/02 22:44:26 krw Exp $ */
+/* $OpenBSD: mbr.c,v 1.74 2021/06/10 15:09:16 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -79,7 +79,7 @@ MBR_init(struct mbr *mbr)
{
extern uint32_t b_arg;
uint64_t adj;
- daddr_t i;
+ daddr_t daddr;
/*
* XXX Do *NOT* zap all MBR parts! Some archs still read initmbr
@@ -148,10 +148,10 @@ MBR_init(struct mbr *mbr)
#endif
/* Start OpenBSD MBR partition on a power of 2 block number. */
- i = 1;
- while (i < DL_SECTOBLK(&dl, mbr->part[3].bs))
- i *= 2;
- adj = DL_BLKTOSEC(&dl, i) - mbr->part[3].bs;
+ daddr = 1;
+ while (daddr < DL_SECTOBLK(&dl, mbr->part[3].bs))
+ daddr *= 2;
+ adj = DL_BLKTOSEC(&dl, daddr) - mbr->part[3].bs;
mbr->part[3].bs += adj;
mbr->part[3].ns -= adj;
PRT_fix_CHS(&mbr->part[3]);