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
certified/1.8.6
Alexandr Anikin 14 years ago
parent 63579a892c
commit e5e49b9c52

@ -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;
}

Loading…
Cancel
Save