1
0
Fork 0
forked from fte/fteqw

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:
Spoike 2010-11-28 19:15:37 +00:00
parent 7b06062137
commit 783698e9d2

View file

@ -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: