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