From: Alexandr Anikin Date: Wed, 4 May 2011 20:50:18 +0000 (+0000) Subject: Fix trivial bug in ooSocket.c codes X-Git-Tag: 1.8.5-rc1~11^2~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5e49b9c52a0556f19fd6a5a126f25318e83601c;p=thirdparty%2Fasterisk.git Fix trivial bug in ooSocket.c codes Revert condition for result code of ast_gethostbyname (closes issue #19185) Reported by: dswartz Patches: issue19185-patch uploaded by may213 (license 454) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316874 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/ooh323c/src/ooSocket.c b/addons/ooh323c/src/ooSocket.c index e2267dc002..b51ba5f2c0 100644 --- a/addons/ooh323c/src/ooSocket.c +++ b/addons/ooh323c/src/ooSocket.c @@ -522,10 +522,10 @@ int ooGetLocalIPAddress(char * pIPAddrs) ret = gethostname(hostname, 100); if(ret == 0) { - if (!(hp = ast_gethostbyname(hostname, &phost))) { + if ((hp = ast_gethostbyname(hostname, &phost))) { struct in_addr i; memcpy(&i, hp->h_addr, sizeof(i)); - strcpy(pIPAddrs, (ast_inet_ntoa(i) == NULL) ? "127.0.0.1" : ast_inet_ntoa(i)); + strcpy(pIPAddrs, (ast_inet_ntoa(i) == NULL) ? "127.0.0.1" : ast_inet_ntoa(i)); } else { return -1; }