From bcbea2523475e9ab071f08e02f51af6b1a4faf05 Mon Sep 17 00:00:00 2001 From: Andreas Mohr <and@gmx.li> Date: Sun, 3 Jan 2016 22:39:52 +0000 Subject: [PATCH] Ticket #3214: avoid invalid free nodes display. nfree and nodes can be -1. Don't print such numbers at info panel. Signed-off-by: Andreas Mohr <and@gmx.li> Signed-off-by: Andrew Borodin <aborodin@vmail.ru> --- src/filemanager/info.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/filemanager/info.c b/src/filemanager/info.c index 0824dbc39..b7327ef46 100644 --- a/src/filemanager/info.c +++ b/src/filemanager/info.c @@ -149,8 +149,13 @@ info_show_info (WInfo * info) case 16: widget_move (w, 16, 3); - if (myfs_stats.nfree == 0 && myfs_stats.nodes == 0) + if ((myfs_stats.nfree == 0 && myfs_stats.nodes == 0) || + (myfs_stats.nfree == (uintmax_t) (-1) && myfs_stats.nodes == (uintmax_t) (-1))) tty_print_string (_("No node information")); + else if (myfs_stats.nfree == (uintmax_t) (-1)) + tty_printf ("%s -/%" PRIuMAX, _("Free nodes:"), myfs_stats.nodes); + else if (myfs_stats.nodes == (uintmax_t) (-1)) + tty_printf ("%s %" PRIuMAX "/-", _("Free nodes:"), myfs_stats.nfree); else tty_printf ("%s %" PRIuMAX "/%" PRIuMAX " (%d%%)", _("Free nodes:"),