From ba344291adaea1903bdb71216b2c7f454f779ce4 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Thu, 27 May 2010 16:50:01 +0000 Subject: =?UTF-8?q?2010-05-27=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * libnetworking/libc/gethostnamadr.c: Try to make crazy address arithmetic more portable. --- cpukit/ChangeLog | 2 ++ cpukit/libnetworking/libc/gethostnamadr.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 35bd8d798d..633c71f7d8 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,7 @@ 2010-05-27 Ralf Corsépius + * libnetworking/libc/gethostnamadr.c: + Try to make crazy address arithmetic more portable. * libfs/src/nfsclient/src/xdr_mbuf.c: Use void* arithmetic instead of u_long arithmetic. * libnetworking/netinet/raw_ip.c, diff --git a/cpukit/libnetworking/libc/gethostnamadr.c b/cpukit/libnetworking/libc/gethostnamadr.c index 213e29d292..709552beb8 100644 --- a/cpukit/libnetworking/libc/gethostnamadr.c +++ b/cpukit/libnetworking/libc/gethostnamadr.c @@ -381,7 +381,7 @@ int gethostbyname_r(const char* name, strcpy(buf,name); result->h_addr_list=(char**)(buf+strlen(name)+1); - result->h_addr_list+=sizeof(unsigned long)-((unsigned long)(result->h_addr_list)&(sizeof(unsigned long)-1)); + result->h_addr_list+=sizeof(char*)-((size_t)(result->h_addr_list)&(sizeof(char*)-1)); result->h_addr_list[0]=(char*)&result->h_addr_list[2]; if (inet_pton(AF_INET,name,result->h_addr_list[0])) { result->h_addrtype=AF_INET; -- cgit v1.2.3