From 74aefddd75b3153c2ea215de82a29f2da9ba3208 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 10:17:40 -0500 Subject: [PATCH] dwarfmonitor: Use a reasonable default for unhandled item types --- plugins/dwarfmonitor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index b715f6351..6f5481369 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1216,7 +1216,18 @@ struct preference_map break; default: - label = string("UNKNOWN ") + ENUM_ATTR_STR(item_type, caption, pref.item_type); + label = ENUM_ATTR_STR(item_type, caption, pref.item_type); + if (label.size()) + { + if (label[label.size() - 1] == 's') + label += "es"; + else + label += "s"; + } + else + { + label = "UNKNOWN"; + } break; }