diff options
Diffstat (limited to 'code/qcommon/net_chan.c')
-rw-r--r-- | code/qcommon/net_chan.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/code/qcommon/net_chan.c b/code/qcommon/net_chan.c index ac7b30b..e4b1739 100644 --- a/code/qcommon/net_chan.c +++ b/code/qcommon/net_chan.c @@ -686,10 +686,9 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) { return qtrue; } - // look for a port number Q_strncpyz( base, s, sizeof( base ) ); - if(*base == '[') + if(*base == '[' || Q_CountChar(base, ':') > 1) { // This is an ipv6 address, handle it specially. search = strchr(base, ']'); @@ -702,10 +701,14 @@ qboolean NET_StringToAdr( const char *s, netadr_t *a, netadrtype_t family ) { port = search + 1; } - search = base + 1; + if(*base == '[') + search = base + 1; + else + search = base; } else { + // look for a port number port = strchr( base, ':' ); if ( port ) { |