Fix gethostname calls (bug #4198, with mods)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-05-08 16:44:25 +00:00
parent fa0f44a347
commit 00bcbaaa05
6 changed files with 17 additions and 17 deletions

View File

@@ -248,7 +248,7 @@ static int restart_monitor(void);
static int capability = AST_FORMAT_ULAW;
static int nonCodecCapability = AST_RTP_DTMF;
static char ourhost[256];
static char ourhost[MAXHOSTNAMELEN];
static struct in_addr __ourip;
static int ourport;
@@ -4096,7 +4096,7 @@ static int reload_config(void)
struct hostent *hp;
int format;
if (gethostname(ourhost, sizeof(ourhost))) {
if (gethostname(ourhost, sizeof(ourhost)-1)) {
ast_log(LOG_WARNING, "Unable to get hostname, MGCP disabled\n");
return 0;
}