Fix byte prefix at low rates so it is two spaces, not one
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
0.0.20230723-UNRELEASED
|
||||
* fix: correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates
|
||||
* cleanup: Rewrote `configure.in` as per suggestions in newer "`autoconf`" manuals
|
||||
* cleanup: replaced `header.in` with one generated by "`autoheader`", moving custom logic to a separate header file "`config-aux.h`"
|
||||
* cleanup: added copyright notice to all source files as per GNU standards
|
||||
|
||||
+7
-2
@@ -199,8 +199,13 @@ static void pv__si_prefix(long double *value, char *prefix,
|
||||
prefix[0] = *i;
|
||||
}
|
||||
|
||||
if (is_bytes && prefix[0] != ' ') {
|
||||
prefix[1] = 'i';
|
||||
/*
|
||||
* Byte prefixes are of the form "KiB" rather than "KB", so that's
|
||||
* two characters, not one - meaning that for just "B", the prefix
|
||||
* is two spaces, not one.
|
||||
*/
|
||||
if (is_bytes) {
|
||||
prefix[1] = (prefix[0] == ' ' ? ' ' : 'i');
|
||||
prefix[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user