nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 928699d4a44a8cb78af928feae71b86c5d6c51b4
parent 4d93a7f9fe4659fe0852ab56ab3ff9ab40dff7bf
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Mon,  5 Mar 2018 08:46:34 +0530

float is suficient and a _little_ faster in coolsize()

Diffstat:
Mnnn.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nnn.c b/nnn.c @@ -1441,7 +1441,7 @@ coolsize(off_t size) static char size_buf[12]; /* Buffer to hold human readable size */ static int i; - static long double rem; + static off_t rem; static const double div_2_pow_10 = 1.0 / 1024.0; i = 0; @@ -1453,7 +1453,7 @@ coolsize(off_t size) ++i; } - snprintf(size_buf, 12, "%.*Lf%c", i, size + rem * div_2_pow_10, U[i]); + snprintf(size_buf, 12, "%.*f%c", i, size + (float)rem * div_2_pow_10, U[i]); return size_buf; }