diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-19 17:53:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-19 17:53:57 +0000 |
commit | 05439698e091782feacccd7437890585c5f2e940 (patch) | |
tree | 0c677bf5f0f19f9c8e409ca7cc1c9f5aa94c8bd7 | |
parent | 698bf6f96d97eb8514c2b47519f120abe1f3df7f (diff) | |
download | rspamd-05439698e091782feacccd7437890585c5f2e940.tar.gz rspamd-05439698e091782feacccd7437890585c5f2e940.zip |
[Minor] Properly print byte suffixes when humanizing
-rw-r--r-- | src/libutil/printf.c | 6 |
1 files 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; |