From 0fa64ba93643aed33f92f3c8067ef33a83adf474 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 3 Dec 2013 16:43:49 +0100 Subject: [PATCH] mutt_pretty_size: show real number for small files If a file is smaller than a certain size it is unfriendly to print 0K or 0,1K as number of mails or as file size. Instead use the real number. Signed-off-by: Olaf Hering --- muttlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/muttlib.c b/muttlib.c index d491650d..7d280cd1 100644 --- a/muttlib.c +++ b/muttlib.c @@ -902,8 +902,8 @@ void mutt_pretty_mailbox (char *s, size_t buflen) void mutt_pretty_size (char *s, size_t len, LOFF_T n) { - if (n == 0) - strfcpy (s, "0K", len); + if (n < 1000) + snprintf (s, len, "%d", (int)n); else if (n < 10189) /* 0.1K - 9.9K */ snprintf (s, len, "%3.1fK", (n < 103) ? 0.1 : n / 1024.0); else if (n < 1023949) /* 10K - 999K */ -- 2.40.0