Skip to content

Commit

Permalink
AddrInfo: Fix error message generation when node == NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Jan 4, 2014
1 parent 5532117 commit b39da20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/network/network.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class AddrInfo {
res( NULL ) { res( NULL ) {
int errcode = getaddrinfo( node, service, hints, &res ); int errcode = getaddrinfo( node, service, hints, &res );
if ( errcode != 0 ) { if ( errcode != 0 ) {
throw NetworkException( std::string( "Bad IP address (" ) + node + "): " + gai_strerror( errcode ), 0 ); throw NetworkException( std::string( "Bad IP address (" ) + (node != NULL ? node : "(null)") + "): " + gai_strerror( errcode ), 0 );
} }
} }
~AddrInfo() { freeaddrinfo(res); } ~AddrInfo() { freeaddrinfo(res); }
Expand Down

0 comments on commit b39da20

Please sign in to comment.