From c7a25f0c0ea77ec865bc405a2df2f8b4953f7ea6 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 3 Jan 2016 22:39:52 +0000
Subject: [PATCH] avoid invalid free nodes display
ticket #3214 illustrate that nfree & nodes can be (uintmax_t) -1
don't print such numbers at info panel
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/filemanager/info.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/filemanager/info.c b/src/filemanager/info.c
index 0824dbc..b6a5fef 100644
a
|
b
|
info_show_info (WInfo * info) |
149 | 149 | |
150 | 150 | case 16: |
151 | 151 | widget_move (w, 16, 3); |
152 | | if (myfs_stats.nfree == 0 && myfs_stats.nodes == 0) |
| 152 | if ((myfs_stats.nfree == 0 && myfs_stats.nodes == 0) || |
| 153 | (myfs_stats.nfree == (uintmax_t) -1 && myfs_stats.nodes == (uintmax_t) -1)) |
153 | 154 | tty_print_string (_("No node information")); |
| 155 | else if (myfs_stats.nfree == (uintmax_t) -1) |
| 156 | tty_printf ("%s -/%" PRIuMAX, |
| 157 | _("Free nodes:"),myfs_stats.nodes); |
| 158 | else if (myfs_stats.nodes == (uintmax_t) -1) |
| 159 | tty_printf ("%s %" PRIuMAX "/-", |
| 160 | _("Free nodes:"),myfs_stats.nfree); |
154 | 161 | else |
155 | 162 | tty_printf ("%s %" PRIuMAX "/%" PRIuMAX " (%d%%)", |
156 | 163 | _("Free nodes:"), |