fix fhostcmd with numeric address
This commit is contained in:
parent
d4a31321ad
commit
8608e23e8f
|
|
@ -18,6 +18,7 @@ Version NEXT
|
|||
fsetup command added to setup.csh
|
||||
fcd: remove trailing \r\n from readme file
|
||||
fcd: do not print empty line after directory protection
|
||||
fsetupcmd: don't crash if called with numeric address
|
||||
|
||||
Version 2.8.1b24 - 19 Feb 2005
|
||||
use getopt from stdio.h instead of getopt.h in fspscan.c
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#ifdef HOST_LOOKUP
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
|
@ -141,13 +142,8 @@ int print_host_setup(struct fsp_host *setup,int csh,int lhost)
|
|||
#endif
|
||||
if (!setup->hostname) lhost=NUMBER;
|
||||
}
|
||||
if (
|
||||
(lhost==NUMBER && !setup->hostaddr)
|
||||
#if HOST_LOOKUP
|
||||
|| lhost==0
|
||||
#endif
|
||||
) {
|
||||
/* look for number */
|
||||
if ((lhost==NUMBER || lhost==0) && !setup->hostaddr) {
|
||||
/* look for IP number */
|
||||
#if HOST_LOOKUP
|
||||
if ( (hp=gethostbyname(setup->hostname)))
|
||||
setup->hostaddr=(char *)inet_ntoa(*(struct in_addr *) * hp->h_addr_list);
|
||||
|
|
@ -162,6 +158,7 @@ int print_host_setup(struct fsp_host *setup,int csh,int lhost)
|
|||
else
|
||||
if(setup->hostname)
|
||||
lhost=NAME;
|
||||
assert(lhost != 0 );
|
||||
} else
|
||||
{
|
||||
if (lhost==NUMBER && !setup->hostaddr)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user