1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-29 15:22:30 +03:00

attempt to fix human-readable unit output when number of sectors is odd

This commit is contained in:
Alasdair Kergon 2007-11-05 17:13:54 +00:00
parent b12bc692af
commit 971f233fb7

View File

@ -186,17 +186,17 @@ static const char *_display_size(const struct cmd_context *cmd,
return size_buf;
}
if (s < 10) {
size *= UINT64_C(512);
if (s < 10)
byte = cmd->current_settings.unit_factor;
size *= UINT64_C(512);
} else {
size /= 2;
else {
suffix = 1;
if (cmd->current_settings.unit_type == 'H')
units = UINT64_C(1000);
else
units = UINT64_C(1024);
byte = units * units * units * units * units;
byte = units * units * units * units * units * units;
s = 0;
while (size_str[s] && size < byte)
s++, byte /= units;