This is an automated email from the ASF dual-hosted git repository. borisk pushed a commit to branch xerces-3.0 in repository https://gitbox.apache.org/repos/asf/xerces-c.git
commit cd58400881d18a06060f9010eb48c483041c1a2e Author: Boris Kolpackov <bor...@apache.org> AuthorDate: Tue May 26 19:57:45 2009 +0000 Check return value of getaddrinfo for non-zero instead of less-than-zero (XERCESC-1871). git-svn-id: https://svn.apache.org/repos/asf/xerces/c/branches/xerces-3.0@778862 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp | 4 ++-- src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp b/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp index f2da962..4990f1b 100644 --- a/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp +++ b/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp @@ -126,11 +126,11 @@ UnixHTTPURLInputStream::UnixHTTPURLInputStream(const XMLURL& urlSource, const XM hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; int n = getaddrinfo(hostNameAsCharStar,portBuffer.getRawBuffer(),&hints, &res); - if(n<0) + if(n != 0) { hints.ai_flags = AI_NUMERICHOST; n = getaddrinfo(hostNameAsCharStar,portBuffer.getRawBuffer(),&hints, &res); - if(n<0) + if(n != 0) ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_TargetResolution, hostName, memoryManager); } janSock.reset(); diff --git a/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp b/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp index 00c2f59..8e13dda 100644 --- a/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp +++ b/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp @@ -334,11 +334,11 @@ BinHTTPURLInputStream::BinHTTPURLInputStream(const XMLURL& urlSource, const XMLN hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; int n = wrap_getaddrinfo(hostNameAsCharStar,portBuffer.getRawBuffer(),&hints, &res); - if(n<0) + if(n != 0) { hints.ai_flags = AI_NUMERICHOST; n = wrap_getaddrinfo(hostNameAsCharStar,(const char*)tempbuf,&hints, &res); - if(n<0) + if(n != 0) ThrowXMLwithMemMgr1(NetAccessorException, XMLExcepts::NetAcc_TargetResolution, hostName, memoryManager); } janSock.reset(); --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org