Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Use the sioctl_open(3) OpenBSD API to access vol
[slstatus.git]
/
util.c
diff --git
a/util.c
b/util.c
index
4c37ab0
..
85366bf
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-94,12
+94,13
@@
bprintf(const char *fmt, ...)
}
const char *
}
const char *
-fmt_human(uint
64
_t num, int base)
+fmt_human(uint
max
_t num, int base)
{
double scaled;
size_t i, prefixlen;
const char **prefix;
{
double scaled;
size_t i, prefixlen;
const char **prefix;
- const char *prefix_1000[] = { "", "k", "M", "G", "T", "P", "E", "Z", "Y" };
+ const char *prefix_1000[] = { "", "k", "M", "G", "T", "P", "E", "Z",
+ "Y" };
const char *prefix_1024[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei",
"Zi", "Yi" };
const char *prefix_1024[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei",
"Zi", "Yi" };
@@
-122,7
+123,7
@@
fmt_human(uint64_t num, int base)
scaled /= base;
}
scaled /= base;
}
- return bprintf("%.1f%s", scaled, prefix[i]);
+ return bprintf("%.1f
%s", scaled, prefix[i]);
}
int
}
int