1
0
mirror of https://github.com/MidnightCommander/mc synced 2025-01-12 14:29:41 +03:00

Merge branch '59_filesize_full_precision'

* 59_filesize_full_precision:
  Ticket : display file size in full precision.
This commit is contained in:
Andrew Borodin 2009-09-07 15:34:55 +04:00
commit 47bc01dea1
3 changed files with 4 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
/*

View File

@ -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);