diff options
author | 1998-07-23 05:21:23 +0000 | |
---|---|---|
committer | 1998-07-23 05:21:23 +0000 | |
commit | 65ce672d2cce7325d6416b81cfe2331de336c0ad (patch) | |
tree | 2286483c59ec9eefd3f20aaac3b3b2bdbca441de | |
parent | Print LBA-based size as well as CHS size. (diff) | |
download | wireguard-openbsd-65ce672d2cce7325d6416b81cfe2331de336c0ad.tar.xz wireguard-openbsd-65ce672d2cce7325d6416b81cfe2331de336c0ad.zip |
Fix annoying bug where disklabel would give you wrong default size for last
partition on disk and then complain when you chose it.
The fix makes sure you get the "correct size".
-rw-r--r-- | sbin/disklabel/editor.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index e70224ebd59..aa4660034f5 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.37 1998/06/21 22:13:52 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.38 1998/07/23 05:21:23 csapuntz Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.37 1998/06/21 22:13:52 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.38 1998/07/23 05:21:23 csapuntz Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1719,11 +1719,11 @@ free_chunks(lp) } } else { /* Last partition */ - if (spp[i]->p_offset + spp[i]->p_size < lp->d_secperunit) { - + if (spp[i]->p_offset + spp[i]->p_size < ending_sector) { + chunks[numchunks].start = spp[i]->p_offset + spp[i]->p_size; - chunks[numchunks].stop = lp->d_secperunit; + chunks[numchunks].stop = ending_sector; numchunks++; } } |