From: wessels <> Date: Sat, 19 Oct 1996 14:21:54 +0000 (+0000) Subject: cleanup; avoid compiler warning X-Git-Tag: SQUID_3_0_PRE1~5624 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b678c10cfba23d85ec73b9caa31c7454b6bca73;p=thirdparty%2Fsquid.git cleanup; avoid compiler warning --- diff --git a/lib/getfullhostname.c b/lib/getfullhostname.c index 2eabf34709..8928d97dca 100644 --- a/lib/getfullhostname.c +++ b/lib/getfullhostname.c @@ -1,6 +1,6 @@ /* - * $Id: getfullhostname.c,v 1.9 1996/10/13 06:19:36 wessels Exp $ + * $Id: getfullhostname.c,v 1.10 1996/10/19 08:21:54 wessels Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -154,8 +154,8 @@ getfullhostname(void) static char buf[SQUIDHOSTNAMELEN + 1]; if (gethostname(buf, SQUIDHOSTNAMELEN) < 0) - return (NULL); - if ((hp = gethostbyname(buf)) == NULL) - return (buf); - return (hp->h_name); + return NULL; + if ((hp = gethostbyname(buf)) != NULL) + strncpy(buf, hp->h_name, SQUIDHOSTNAMELEN); + return buf; }