Skip to content

Commit

Permalink
network: do not print an invalid (0-length) address
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyPec committed Feb 22, 2024
1 parent 5f963e3 commit fe895b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/network/model/address.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ operator<(const Address& a, const Address& b)
std::ostream&
operator<<(std::ostream& os, const Address& address)
{
if (address.m_len == 0)
{
return os;
}
os.setf(std::ios::hex, std::ios::basefield);
os.fill('0');
os << std::setw(2) << (uint32_t)address.m_type << "-" << std::setw(2) << (uint32_t)address.m_len
Expand Down

0 comments on commit fe895b5

Please sign in to comment.