mirror of https://github.com/MidnightCommander/mc
Fixed int overflow in free modes calculation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
f16ef2090d
commit
bef2bcebda
|
@ -125,10 +125,11 @@ info_show_info (struct WInfo *info)
|
|||
case 16:
|
||||
widget_move (&info->widget, 16, 3);
|
||||
if (myfs_stats.nfree > 0 || myfs_stats.nodes > 0)
|
||||
tty_printf (_("Free nodes: %d (%d%%) of %d"),
|
||||
myfs_stats.nfree,
|
||||
myfs_stats.total
|
||||
? 100 * myfs_stats.nfree / myfs_stats.nodes : 0, myfs_stats.nodes);
|
||||
tty_printf (_("Free nodes: %ld (%ld%%) of %ld"),
|
||||
(size_t) myfs_stats.nfree,
|
||||
myfs_stats.total != 0
|
||||
? 100 * (size_t) myfs_stats.nfree / (size_t) myfs_stats.nodes : 0,
|
||||
(size_t) myfs_stats.nodes);
|
||||
else
|
||||
tty_print_string (_("No node information"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue