diff --git a/base/dictionary.cpp b/base/dictionary.cpp index af4eeeed1..d98daa440 100644 --- a/base/dictionary.cpp +++ b/base/dictionary.cpp @@ -255,11 +255,11 @@ void Dictionary::AddUnnamedProperty(const Variant& value) { map::const_iterator it; string key; + long index = GetLength(); do { - long index = GetLength(); - stringstream s; - s << "_" << GetLength(); + s << "_" << index; + index++; key = s.str(); it = m_Data.find(key); diff --git a/icinga/virtualendpoint.cpp b/icinga/virtualendpoint.cpp index 85cf6afeb..20a1a0573 100644 --- a/icinga/virtualendpoint.cpp +++ b/icinga/virtualendpoint.cpp @@ -24,7 +24,7 @@ using namespace icinga; string VirtualEndpoint::GetAddress(void) const { char address[50]; - sprintf(address, "virtual:%p", this); + sprintf(address, "virtual:%p", (void *)this); return address; }