diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2023-01-14 18:21:47 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2023-01-14 18:21:47 +0000 |
commit | 349f21b018fdca9463438de483454f2a19906717 (patch) | |
tree | 4463660890bfa0e23afe8822fdea3b616cb52df4 /sbin | |
parent | dbfc48657302388991d31db1751974358c1963eb (diff) |
Replace comparisons/assignments to '3' with equivalent comparisons to RAW_PART
and assignment to RAW_PART + 1.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/editor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 6470e2c4a54..5369a7f874d 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.387 2023/01/13 14:24:17 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.388 2023/01/14 18:21:46 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <millert@openbsd.org> @@ -214,10 +214,10 @@ editor(int f) /* If we don't have a 'c' partition, create one. */ pp = &newlab.d_partitions[RAW_PART]; - if (newlab.d_npartitions < 3 || DL_GETPSIZE(pp) == 0) { + if (newlab.d_npartitions <= RAW_PART || DL_GETPSIZE(pp) == 0) { puts("No 'c' partition found, adding one that spans the disk."); - if (newlab.d_npartitions < 3) - newlab.d_npartitions = 3; + if (newlab.d_npartitions <= RAW_PART) + newlab.d_npartitions = RAW_PART + 1; DL_SETPOFFSET(pp, 0); DL_SETPSIZE(pp, DL_GETDSIZE(&newlab)); pp->p_fstype = FS_UNUSED; |