Move declarations up

This commit is contained in:
Arun Prakash Jana 2019-07-05 02:47:55 +05:30
parent a25e878dfc
commit afdfcecb9c
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -2179,13 +2179,13 @@ static char *coolsize(off_t size)
} }
if (i > 0 && i < 6 && rem) { if (i > 0 && i < 6 && rem) {
ret = xstrlcpy(size_buf, xitoa(size), 11);
size_buf[ret - 1] = '.';
char *frac = xitoa(rem); char *frac = xitoa(rem);
size_t toprint = i > 3 ? 3 : i; size_t toprint = i > 3 ? 3 : i;
size_t len = strlen(frac); size_t len = strlen(frac);
ret = xstrlcpy(size_buf, xitoa(size), 11);
size_buf[ret - 1] = '.';
if (len < toprint) { if (len < toprint) {
size_buf[ret] = size_buf[ret + 1] = size_buf[ret + 2] = '0'; 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, (toprint - len) + 1);