diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2019-07-14 22:27:22 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2019-07-14 22:27:22 +0530 |
commit | ba099b6818cdedaefe8f0e850091d25e1d493aed (patch) | |
tree | 5f92c66814f4ba1b5084bbdaea8c7b4b71ac72cc | |
parent | 0bc5d82d2f479a8fb87831e536e4640b586bf103 (diff) | |
download | nnn-ba099b6818cdedaefe8f0e850091d25e1d493aed.tar.gz |
Fix coolsize
-rw-r--r-- | src/nnn.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2199,7 +2199,7 @@ static char *coolsize(off_t size) } if (i > 0 && i < 6 && rem) { - ret = xstrlcpy(size_buf, xitoa(size), 11); + ret = xstrlcpy(size_buf, xitoa(size), 12); size_buf[ret - 1] = '.'; char *frac = xitoa(rem); @@ -2208,13 +2208,13 @@ static char *coolsize(off_t size) if (len < toprint) { size_buf[ret] = size_buf[ret + 1] = size_buf[ret + 2] = '0'; - xstrlcpy(size_buf + ret + (toprint - len), frac, (toprint - len) + 1); + xstrlcpy(size_buf + ret + (toprint - len), frac, len + 1); } else xstrlcpy(size_buf + ret, frac, toprint + 1); ret += toprint; } else { - ret = xstrlcpy(size_buf, size ? xitoa(size) : "0", 10); + ret = xstrlcpy(size_buf, size ? xitoa(size) : "0", 12); --ret; } |