diff options
Diffstat (limited to 'zwgc/subscriptions.c')
-rw-r--r-- | zwgc/subscriptions.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zwgc/subscriptions.c b/zwgc/subscriptions.c index 5b0567b..c319729 100644 --- a/zwgc/subscriptions.c +++ b/zwgc/subscriptions.c @@ -222,16 +222,17 @@ char ourhost[MAXHOSTNAMELEN],ourhostcanon[MAXHOSTNAMELEN]; static void inithosts() { struct hostent *hent; - if (gethostname(ourhost,sizeof(ourhost)-1) == -1) { + if (gethostname(ourhost, sizeof(ourhost)-1) == -1) { ERROR3("unable to retrieve hostname, %s and %s will be wrong in subscriptions.\n", TOKEN_HOSTNAME, TOKEN_CANONNAME); return; } if (!(hent = gethostbyname(ourhost))) { ERROR2("unable to resolve hostname, %s will be wrong in subscriptions.\n", TOKEN_CANONNAME); + strncpy(ourhostcanon, ourhost, sizeof(ourhostcanon)-1); return; } - (void) strncpy(ourhostcanon,hent->h_name, sizeof(ourhostcanon)-1); + strncpy(ourhostcanon, hent->h_name, sizeof(ourhostcanon)-1); return; } |