summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-06-20 19:29:18 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:11:07 +0200
commit2957d89083ec3d0a8bc789dbff0659799cdf4a85 (patch)
tree07b7dadd000102f38c10e77e61d4bc53b2f2ef41
parent569c5702b6ee7d09fb6adee21184d79eadfaa228 (diff)
downloadmpv-2957d89083ec3d0a8bc789dbff0659799cdf4a85.tar.bz2
mpv-2957d89083ec3d0a8bc789dbff0659799cdf4a85.tar.xz
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
-rw-r--r--stream/tcp.c6
1 files 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 );