]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix trivial bug in ooSocket.c codes
authorAlexandr Anikin <may@telecom-service.ru>
Wed, 4 May 2011 20:50:18 +0000 (20:50 +0000)
committerAlexandr Anikin <may@telecom-service.ru>
Wed, 4 May 2011 20:50:18 +0000 (20:50 +0000)
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

addons/ooh323c/src/ooSocket.c

index e2267dc002b9cf094c7cbd1f38991c4c1c7ddadc..b51ba5f2c06f7ea60c1954f38c9ba01ea8bfacdd 100644 (file)
@@ -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;
       }