diff options
author | Mark Spencer <markster@digium.com> | 2005-05-08 16:44:25 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-05-08 16:44:25 +0000 |
commit | 00bcbaaa050472058d1a26295fb3741f2b467e38 (patch) | |
tree | 43cbdcb172a60d2c629ea2fd39d2314ccdc1db2e /logger.c | |
parent | fa0f44a347a541ee1e996895c6b00df83b819e59 (diff) |
Fix gethostname calls (bug #4198, with mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'logger.c')
-rwxr-xr-x | logger.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -75,7 +75,7 @@ static struct msglist { struct msglist *next; } *list = NULL, *last = NULL; -static char hostname[256]; +static char hostname[MAXHOSTNAMELEN]; enum logtypes { LOGTYPE_SYSLOG, @@ -294,7 +294,7 @@ static void init_logger_chain(void) ast_mutex_lock(&loglock); if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) { if(ast_true(s)) { - if(gethostname(hostname, sizeof(hostname))) { + if(gethostname(hostname, sizeof(hostname)-1)) { strncpy(hostname, "unknown", sizeof(hostname)-1); ast_log(LOG_WARNING, "What box has no hostname???\n"); } |