1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00

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:
attila 2010-06-20 19:29:18 +00:00 committed by Uoti Urpala
parent 569c5702b6
commit 2957d89083

View File

@ -186,10 +186,10 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
return TCP_ERROR_FATAL;
}
#if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
#else
#if HAVE_INET_PTON
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
if(verb) mp_tmsg(MSGT_NETWORK,MSGL_STATUS,"Connecting to server %s[%s]: %d...\n", host, buf , port );