From: Gunnar Beutner Date: Wed, 15 Oct 2014 16:41:52 +0000 (+0200) Subject: Fix formatting for non-string values in arrays X-Git-Tag: v2.2.0~374 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=408939c9fbe2119d6aaba588ead74317fb889138;p=icinga2 Fix formatting for non-string values in arrays fixes #7388 --- diff --git a/lib/cli/objectlistcommand.cpp b/lib/cli/objectlistcommand.cpp index 69d4e3a20..03ba36fed 100644 --- a/lib/cli/objectlistcommand.cpp +++ b/lib/cli/objectlistcommand.cpp @@ -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& type_cou typedef std::map::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); } }