diff options
-rw-r--r-- | sbin/disklabel/editor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 79e9245e32d..44415ca2357 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.114 2007/06/01 21:51:15 todd Exp $ */ +/* $OpenBSD: editor.c,v 1.115 2007/06/04 20:23:32 otto Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.114 2007/06/01 21:51:15 todd Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.115 2007/06/04 20:23:32 otto Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1117,7 +1117,7 @@ getuint(struct disklabel *lp, int partno, char *prompt, char *helpstring, /* If we round up past the end, round down instead */ cyls = (rval + lp->d_secpercyl / 2) / lp->d_secpercyl; if (cyls != 0 && lp->d_secpercyl != 0) { - if ((cyls * lp->d_secpercyl) - offset > maxval) + if (cyls > 1 && (cyls * lp->d_secpercyl) - offset > maxval) cyls--; if (rval != (cyls * lp->d_secpercyl) - offset) { |