mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Ticket #59: display file size in full precision.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a301a7c8a5
commit
f559aeb6b9
@ -222,7 +222,7 @@ string_file_size (file_entry *fe, int len)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
size_trunc_len (buffer, len, fe->st.st_size, 0);
|
||||
size_trunc_len (buffer, (unsigned int) len, fe->st.st_size, 0);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ size_trunc_sep (double size)
|
||||
* 0=bytes, 1=Kbytes, 2=Mbytes, etc.
|
||||
*/
|
||||
void
|
||||
size_trunc_len (char *buffer, int len, off_t size, int units)
|
||||
size_trunc_len (char *buffer, unsigned int len, off_t size, int units)
|
||||
{
|
||||
/* Avoid taking power for every file. */
|
||||
static const off_t power10 [] =
|
||||
@ -333,8 +333,7 @@ size_trunc_len (char *buffer, int len, off_t size, int units)
|
||||
int j = 0;
|
||||
int size_remain;
|
||||
|
||||
/* Don't print more than 9 digits - use suffix. */
|
||||
if (len == 0 || len > 9)
|
||||
if (len == 0)
|
||||
len = 9;
|
||||
|
||||
/*
|
||||
|
@ -66,7 +66,7 @@ const char *size_trunc_sep (double size);
|
||||
* not including trailing 0. BUFFER should be at least LEN+1 long.
|
||||
*
|
||||
* Units: size units (0=bytes, 1=Kbytes, 2=Mbytes, etc.) */
|
||||
void size_trunc_len (char *buffer, int len, off_t size, int units);
|
||||
void size_trunc_len (char *buffer, unsigned int len, off_t size, int units);
|
||||
int is_exe (mode_t mode);
|
||||
const char *string_perm (mode_t mode_bits);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user