msgr: fix operator<< for sockaddr_in, too

This commit is contained in:
Sage Weil 2009-10-07 10:32:11 -07:00
parent bde055a19f
commit 529f5b8ac1

View File

@ -21,7 +21,7 @@ inline ostream& operator<<(ostream& out, const sockaddr_storage &ss)
inline ostream& operator<<(ostream& out, const sockaddr_in &ss)
{
char buf[NI_MAXHOST];
char buf[NI_MAXHOST] = { 0 };
getnameinfo((struct sockaddr *)&ss, sizeof(ss), buf, sizeof(buf), 0, 0, NI_NUMERICHOST);
return out << buf;
}