commit 0543969: [Minor] Properly print byte suffixes when humanizing
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Mar 19 18:00:04 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-03-19 17:53:57 +0000
URL: https://github.com/rspamd/rspamd/commit/05439698e091782feacccd7437890585c5f2e940
[Minor] Properly print byte suffixes when humanizing
---
src/libutil/printf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libutil/printf.c b/src/libutil/printf.c
index 476c4de40..3c4acef47 100644
--- a/src/libutil/printf.c
+++ b/src/libutil/printf.c
@@ -60,14 +60,14 @@ rspamd_humanize_number (gchar *buf, gchar *last, gint64 num, gboolean bytes)
if (!bytes) {
divisor = 1000;
- prefixes = "\0\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E";
+ prefixes = "\0\0\0\0k\0\0\0M\0\0\0G\0\0\0T\0\0\0P\0\0\0E";
}
else {
divisor = 1024;
- prefixes = "B\0\0k\0\0M\0\0G\0\0T\0\0P\0\0E";
+ prefixes = "B\0\0\0KiB\0MiB\0GiB\0TiB\0PiB\0EiB";
}
-#define SCALE2PREFIX(scale) (&prefixes[(scale) * 3])
+#define SCALE2PREFIX(scale) (&prefixes[(scale) * 4])
if (num < 0) {
sign = -1;
More information about the Commits
mailing list