summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2018-04-26 13:07:55 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2018-04-26 13:07:55 +0000
commit7cae81c631947740798dee81309d183168849049 (patch)
tree685d513efa54beab284967b631c9b04c9201c33a /sbin
parent8de66790e65d3ca7f891684cfdec0239f5764859 (diff)
Fix previous. Adding "offset" to "maxval" was required.
ok otto krw
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 4f368c85245..205285f4b6e 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.329 2018/04/26 10:58:11 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.330 2018/04/26 13:07:54 yasuoka Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -1243,7 +1243,7 @@ getuint64(struct disklabel *lp, char *prompt, char *helpstring,
/* Round to start of next cylinder <= maxval */
nextcyl = ((offset + rval + secpercyl - 1) / secpercyl)
* secpercyl;
- lastcyl = (maxval / secpercyl) * secpercyl;
+ lastcyl = ((maxval + offset) / secpercyl) * secpercyl;
if (nextcyl > lastcyl)
nextcyl = lastcyl;
rval = nextcyl - offset;