If there's no port set, let the receiver use a default port without parsing a 0.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3676 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
7b06062137
commit
783698e9d2
1 changed files with 17 additions and 6 deletions
|
@ -358,12 +358,23 @@ char *NET_AdrToString (char *s, int len, netadr_t a)
|
|||
#endif
|
||||
case NA_BROADCAST_IP:
|
||||
case NA_IP:
|
||||
snprintf (s, len, "%i.%i.%i.%i:%i",
|
||||
a.address.ip[0],
|
||||
a.address.ip[1],
|
||||
a.address.ip[2],
|
||||
a.address.ip[3],
|
||||
ntohs(a.port));
|
||||
if (a.port)
|
||||
{
|
||||
snprintf (s, len, "%i.%i.%i.%i:%i",
|
||||
a.address.ip[0],
|
||||
a.address.ip[1],
|
||||
a.address.ip[2],
|
||||
a.address.ip[3],
|
||||
ntohs(a.port));
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf (s, len, "%i.%i.%i.%i",
|
||||
a.address.ip[0],
|
||||
a.address.ip[1],
|
||||
a.address.ip[2],
|
||||
a.address.ip[3]);
|
||||
}
|
||||
break;
|
||||
#ifdef TCPCONNECT
|
||||
case NA_TCPV6:
|
||||
|
|
Loading…
Reference in a new issue