From 2957d89083ec3d0a8bc789dbff0659799cdf4a85 Mon Sep 17 00:00:00 2001 From: attila Date: Sun, 20 Jun 2010 19:29:18 +0000 Subject: [PATCH] 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 --- stream/tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stream/tcp.c b/stream/tcp.c index a3bf264b6e..1f93571b55 100644 --- a/stream/tcp.c +++ b/stream/tcp.c @@ -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 );