mirror of https://github.com/MidnightCommander/mc
* info.c (info_show_info): Cast myfs_stats.avail to double to
fix integer overflow that can cause a negative precent number.
This commit is contained in:
parent
6d176d4cb6
commit
1866c37dbf
|
@ -1,3 +1,8 @@
|
|||
2003-05-27 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* info.c (info_show_info): Cast myfs_stats.avail to double to
|
||||
fix integer overflow that can cause a negative precent number.
|
||||
|
||||
2003-05-05 Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
|
||||
|
||||
* main.c (directory_history_add): Don't change the directory
|
||||
|
|
|
@ -123,7 +123,8 @@ info_show_info (WInfo *info)
|
|||
size_trunc_len (buffer1, 5, myfs_stats.avail, 1);
|
||||
size_trunc_len (buffer2, 5, myfs_stats.total, 1);
|
||||
printw (_("Free space: %s (%d%%) of %s"), buffer1, myfs_stats.total ?
|
||||
100 * myfs_stats.avail / myfs_stats.total : 0, buffer2);
|
||||
(int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
|
||||
buffer2);
|
||||
} else
|
||||
addstr (_("No space information"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue