mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-04 23:21:28 +03:00
* screen.c: Changed the return type of ilog10 to unsigned int
and adjusted some variables in format_device_number.
This commit is contained in:
parent
64afc0126c
commit
476927920b
@ -1,3 +1,8 @@
|
||||
2005-02-23 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* screen.c: Changed the return type of ilog10 to unsigned int
|
||||
and adjusted some variables in format_device_number.
|
||||
|
||||
2005-02-22 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* unixcompat.h: Added missing parenthesis to the minor() macro.
|
||||
|
@ -192,9 +192,9 @@ string_file_name (file_entry *fe, int len)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static inline int ilog10(dev_t n)
|
||||
static inline unsigned int ilog10(dev_t n)
|
||||
{
|
||||
int digits = 0;
|
||||
unsigned int digits = 0;
|
||||
do {
|
||||
digits++, n /= 10;
|
||||
} while (n != 0);
|
||||
@ -205,8 +205,8 @@ static void format_device_number (char *buf, size_t bufsize, dev_t dev)
|
||||
{
|
||||
dev_t major_dev = major(dev);
|
||||
dev_t minor_dev = minor(dev);
|
||||
int major_digits = ilog10(major_dev);
|
||||
int minor_digits = ilog10(minor_dev);
|
||||
unsigned int major_digits = ilog10(major_dev);
|
||||
unsigned int minor_digits = ilog10(minor_dev);
|
||||
|
||||
g_assert(bufsize >= 1);
|
||||
if (major_digits + 1 + minor_digits + 1 <= bufsize) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user