Fixed int overflow in free modes calculation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2010-05-31 22:04:36 +04:00
parent f16ef2090d
commit bef2bcebda
1 changed files with 5 additions and 4 deletions

View File

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