mirror of https://github.com/mpv-player/mpv
stream/tcp.c: Prefer the use of inet_ntop over inet_ntoa
inet_ntop is ipv6 safe. This fixes bug #1491. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31498 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
569c5702b6
commit
2957d89083
|
@ -186,10 +186,10 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
|
||||||
return TCP_ERROR_FATAL;
|
return TCP_ERROR_FATAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
|
#if HAVE_INET_PTON
|
||||||
av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
|
|
||||||
#else
|
|
||||||
inet_ntop(af, our_s_addr, buf, 255);
|
inet_ntop(af, our_s_addr, buf, 255);
|
||||||
|
#elif HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
|
||||||
|
av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
|
||||||
#endif
|
#endif
|
||||||
if(verb) mp_tmsg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]: %d...\n", host, buf , port );
|
if(verb) mp_tmsg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]: %d...\n", host, buf , port );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue