From bef2bcebda420491b0abbe453a6cb3521b831c4f Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 31 May 2010 22:04:36 +0400 Subject: [PATCH] Fixed int overflow in free modes calculation. Signed-off-by: Andrew Borodin --- src/info.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/info.c b/src/info.c index 9e5a89cc7..f6e875c26 100644 --- a/src/info.c +++ b/src/info.c @@ -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"));