diff options
-rw-r--r-- | src/load-graph.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/load-graph.cpp b/src/load-graph.cpp index 07b0d2e..918ebd7 100644 --- a/src/load-graph.cpp +++ b/src/load-graph.cpp @@ -339,8 +339,12 @@ namespace used_text = procman::format_size(used); total_text = procman::format_size(total); - // xgettext: 540MiB (53 %) of 1.0 GiB - text = g_strdup_printf(_("%s (%.1f %%) of %s"), used_text, 100.0 * percent, total_text); + if (total == 0) { + text = g_strdup(_("not available")); + } else { + // xgettext: 540MiB (53 %) of 1.0 GiB + text = g_strdup_printf(_("%s (%.1f %%) of %s"), used_text, 100.0 * percent, total_text); + } gtk_label_set_text(label, text); g_free(used_text); g_free(total_text); |