diff options
Diffstat (limited to 'cpp/src/qpid/cluster/Cpg.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Cpg.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cpp/src/qpid/cluster/Cpg.cpp b/cpp/src/qpid/cluster/Cpg.cpp index 316b5386f1..49a814b848 100644 --- a/cpp/src/qpid/cluster/Cpg.cpp +++ b/cpp/src/qpid/cluster/Cpg.cpp @@ -217,12 +217,15 @@ MemberId Cpg::self() const { namespace { int byte(uint32_t value, int i) { return (value >> (i*8)) & 0xff; } } -ostream& operator <<(ostream& out, const MemberId& id) { - out << byte(id.first, 0) << "." - << byte(id.first, 1) << "." - << byte(id.first, 2) << "." - << byte(id.first, 3); - return out << ":" << id.second; +ostream& operator<<(ostream& out, const MemberId& id) { + if (id.first) { + out << byte(id.first, 0) << "." + << byte(id.first, 1) << "." + << byte(id.first, 2) << "." + << byte(id.first, 3) + << ":"; + } + return out << id.second; } ostream& operator<<(ostream& o, const ConnectionId& c) { |
