diff options
author | Brian Somers <brian@FreeBSD.org> | 1999-04-07 08:26:50 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1999-04-07 08:26:50 +0000 |
commit | bc19c8517d1688a79cdce7e472db43fec238045b (patch) | |
tree | da26d329ad6cb63443a7b54d4d5eba241206eb65 /lib/libutil/realhostname.c | |
parent | 10b66c2f42d1ce655dd750cd97725179c468031a (diff) |
Notes
Diffstat (limited to 'lib/libutil/realhostname.c')
-rw-r--r-- | lib/libutil/realhostname.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libutil/realhostname.c b/lib/libutil/realhostname.c index ff57011ee33b..240f92974fbc 100644 --- a/lib/libutil/realhostname.c +++ b/lib/libutil/realhostname.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id:$ + * $Id: realhostname.c,v 1.1 1999/04/06 23:02:35 brian Exp $ */ #include <sys/param.h> @@ -45,13 +45,13 @@ realhostname(char *host, size_t hsize, const struct in_addr *ip) struct hostent *hp; result = HOSTNAME_INVALIDADDR; - hp = gethostbyaddr((char *)ip, sizeof *ip, AF_INET); + hp = gethostbyaddr((char *)ip, sizeof(*ip), AF_INET); if (hp != NULL && strlen(hp->h_name) <= hsize) { - char lookup[MAXHOSTNAMELEN + 1]; + char lookup[MAXHOSTNAMELEN]; - strncpy(lookup, hp->h_name, sizeof lookup - 1); - lookup[sizeof lookup - 1] = '\0'; + strncpy(lookup, hp->h_name, sizeof(lookup) - 1); + lookup[sizeof(lookup) - 1] = '\0'; hp = gethostbyname(lookup); if (hp == NULL) result = HOSTNAME_INVALIDNAME; @@ -60,7 +60,7 @@ realhostname(char *host, size_t hsize, const struct in_addr *ip) result = HOSTNAME_INCORRECTNAME; break; } - if (!memcmp(*hp->h_addr_list, ip, sizeof *ip)) { + if (!memcmp(*hp->h_addr_list, ip, sizeof(*ip))) { strncpy(host, lookup, hsize); return HOSTNAME_FOUND; } |