diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-04-29 18:31:36 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-04-29 18:31:36 +0000 |
commit | 24e611d29fab672dd204063b1be94008a605f986 (patch) | |
tree | ebf059a114d38c81618afe1fe23a6702e2215dda /sbin | |
parent | 1941b91e8bb1bd07d35227f7ae98ff0954813cea (diff) |
fix rounding in the modify case; ok millert@ miod@
Diffstat (limited to 'sbin')
-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 5aea87b2bb8..2366dbf29d3 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.111 2007/04/26 23:20:41 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.112 2007/04/29 18:31:35 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.111 2007/04/26 23:20:41 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.112 2007/04/29 18:31:35 otto Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -1997,9 +1997,9 @@ get_size(struct disklabel *lp, int partno, u_int32_t *freep, int new) for (;;) { ui = getuint(lp, partno, "size", "Size of the partition.", - pp->p_size, *freep, pp->p_offset, DO_CONVERSIONS | - ((pp->p_fstype == FS_BSDFFS || pp->p_fstype == FS_SWAP) ? - DO_ROUNDING : 0)); + pp->p_size, *freep + new ? 0 : pp->p_size, pp->p_offset, + DO_CONVERSIONS | ((pp->p_fstype == FS_BSDFFS || + pp->p_fstype == FS_SWAP) ? DO_ROUNDING : 0)); if (ui == UINT_MAX - 1) { fputs("Command aborted\n", stderr); return(1); |