From b827f4eb47ef05152cedb20da58a9fe33ab47b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 8 Jan 2010 00:04:23 +0000 Subject: [PATCH] Currently, the replacement which is used if inet_aton isn't available, only works correctly on little-endian. The attached patch makes it endian independent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Martin Storsjö <$firstname()$firstname,st>. Originally committed as revision 21080 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/os_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 6763e39cf9..96cd347b9e 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -54,7 +54,7 @@ int inet_aton (const char * str, struct in_addr * add) if (!add1 || (add1|add2|add3|add4) > 255) return 0; - add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1; + add->s_addr = htonl((add1 << 24) + (add2 << 16) + (add3 << 8) + add4); return 1; }