[misc] set default size for ReFS and fix multiple other issues

* ReFS only applies for drives that are larger than 512MB
* Also fix error handling and messages in format.c
* Also add Alt-Q cheat mode for proper size units, and improve human readable size output
This commit is contained in:
Pete Batard 2014-04-02 22:47:35 +01:00
parent 0def2bacef
commit 3462ae1062
5 changed files with 66 additions and 44 deletions

View file

@ -188,7 +188,8 @@ char* SizeToHumanReadable(uint64_t size, BOOL log, BOOL fake_units)
safe_sprintf(str_size, sizeof(str_size), "%d%s", i_size, _msg_table[MSG_020+suffix-MSG_000]);
}
} else {
safe_sprintf(str_size, sizeof(str_size), "%0.1f %s", hr_size, _msg_table[MSG_020+suffix-MSG_000]);
safe_sprintf(str_size, sizeof(str_size), (hr_size * 10.0 - (floor(hr_size) * 10.0)) < 1.0?
"%0.0f %s":"%0.1f %s", hr_size, _msg_table[MSG_020+suffix-MSG_000]);
}
return str_size;
}