]> granicus.if.org Git - icinga2/commitdiff
Fix formatting for non-string values in arrays
authorGunnar Beutner <gunnar@beutner.name>
Wed, 15 Oct 2014 16:41:52 +0000 (18:41 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 15 Oct 2014 16:41:52 +0000 (18:41 +0200)
fixes #7388

lib/cli/objectlistcommand.cpp

index 69d4e3a2098d70b3b3683d16cacd23c08236014c..03ba36fed80dd1ca15403e162975d4b6b25f795a 100644 (file)
@@ -159,7 +159,7 @@ String ObjectListCommand::FormatProperties(const Dictionary::Ptr& props, const D
        int offset = 2;
 
        BOOST_FOREACH(const Dictionary::Pair& kv, props) {
-               Value key = kv.first;
+               String key = kv.first;
                Value val = kv.second;
 
                /* key & value */
@@ -214,7 +214,7 @@ String ObjectListCommand::FormatTypeCounts(const std::map<String, int>& type_cou
 
        typedef std::map<String, int>::value_type TypeCount;
 
-       BOOST_FOREACH(TypeCount kv, type_count) {
+       BOOST_FOREACH(const TypeCount& kv, type_count) {
                msgbuf << "Found " << kv.second << " " << kv.first << " objects.\n";
        }
 
@@ -246,7 +246,7 @@ String ObjectListCommand::FormatArray(const Array::Ptr& arr)
                        else
                                str += ", ";
 
-                       str += "'" + Convert::ToString(value) + "'";
+                       str += FormatValue(value);
                }
        }