From d681a084d993c2f1a96a8dfc749108eea1c69822 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 11 Nov 2015 10:38:31 +0100 Subject: [PATCH] nwrap: simplify nwrap_file_getaddrinfo: remove a variable Signed-off-by: Michael Adam Reviewed-by: Andreas Schneider --- lib/nss_wrapper/nss_wrapper.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 653b8d7bfcd..b55e24e4b80 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -3479,8 +3479,7 @@ static struct addrinfo *nwrap_files_getaddrinfo(const char *name, const struct addrinfo *hints, struct addrinfo **ai_tail) { - struct nwrap_entlist *el_head; - struct nwrap_entlist *el_cur; + struct nwrap_entlist *el; struct hostent *he; struct addrinfo *ai = NULL; struct addrinfo *ai_head = NULL; @@ -3519,12 +3518,11 @@ static struct addrinfo *nwrap_files_getaddrinfo(const char *name, NWRAP_LOG(NWRAP_LOG_DEBUG, "Name: %s found.", h_name_lower); SAFE_FREE(h_name_lower); - el_head = (struct nwrap_entlist *)e_p->data; - - for (el_cur = el_head; el_cur != NULL; el_cur = el_cur->next) { + for (el = (struct nwrap_entlist *)e_p->data; el != NULL; el = el->next) + { int rc; - he = &(el_cur->ed->ht); + he = &(el->ed->ht); if (hints->ai_family != AF_UNSPEC && he->h_addrtype != hints->ai_family) {