diff options
| author | Rebecca Cran <brucec@FreeBSD.org> | 2010-06-16 15:40:13 +0000 |
|---|---|---|
| committer | Rebecca Cran <brucec@FreeBSD.org> | 2010-06-16 15:40:13 +0000 |
| commit | 963bebcbf073199b15c8422a153f4d8778b6fe07 (patch) | |
| tree | 0c4340ac2b478dfae256f3cb95e737252c2e545d /usr.sbin/sysinstall/label.c | |
| parent | 773b251c07fafbcd18e029da6fb640e167b79e43 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/sysinstall/label.c')
| -rw-r--r-- | usr.sbin/sysinstall/label.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index 08cd3dfe5e573..c5c06ea7cad30 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -999,6 +999,7 @@ diskLabel(Device *dev) else { char *val; daddr_t size; + long double dsize; struct chunk *tmp; char osize[80]; u_long flags = 0; @@ -1019,22 +1020,24 @@ diskLabel(Device *dev) #endif "%jd blocks (%jdMB) are free.", (intmax_t)sz, (intmax_t)sz / ONE_MEG); - if (!val || (size = strtoimax(val, &cp, 0)) <= 0) { + if (!val || (dsize = strtold(val, &cp)) <= 0) { clear_wins(); break; } if (*cp) { if (toupper(*cp) == 'M') - size *= ONE_MEG; + size = (daddr_t) (dsize * ONE_MEG); else if (toupper(*cp) == 'G') - size *= ONE_GIG; + size = (daddr_t) (dsize * ONE_GIG); #ifndef __ia64__ else if (toupper(*cp) == 'C') - size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); + size = (daddr_t) dsize * (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); #endif + else + size = (daddr_t) dsize; } - if (size <= FS_MIN_SIZE) { + if (size < FS_MIN_SIZE) { msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG); clear_wins(); break; |
