-/* $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
{
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
#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]);