From 7cb78dc73fa87fb145a0e8dce34794c4e423d175 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Tue, 10 Jul 2001 11:59:55 +0000 Subject: [PATCH] (add_hostent): adapt to const hostent_find_fqdn git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10309 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/getaddrinfo.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/roken/getaddrinfo.c b/lib/roken/getaddrinfo.c index 61cb7019f..82d8626c7 100644 --- a/lib/roken/getaddrinfo.c +++ b/lib/roken/getaddrinfo.c @@ -227,22 +227,23 @@ add_hostent (int port, int protocol, int socktype, if (*flags & AI_CANONNAME) { struct hostent *he2 = NULL; + const char *tmp_canon; - canonname = hostent_find_fqdn (he); - if (strchr (canonname, '.') == NULL) { + tmp_canon = hostent_find_fqdn (he); + if (strchr (tmp_canon, '.') == NULL) { int error; he2 = getipnodebyaddr (he->h_addr_list[0], he->h_length, he->h_addrtype, &error); if (he2 != NULL) { - char *tmp = hostent_find_fqdn (he2); + const char *tmp = hostent_find_fqdn (he2); if (strchr (tmp, '.') != NULL) - canonname = tmp; + tmp_canon = tmp; } } - canonname = strdup (canonname); + canonname = strdup (tmp_canon); if (he2 != NULL) freehostent (he2); if (canonname == NULL)