nwrap: simplify nwrap_files_gethostbyname: remove a variable
authorMichael Adam <obnox@samba.org>
Wed, 11 Nov 2015 09:36:07 +0000 (10:36 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 11 Jan 2016 11:25:29 +0000 (12:25 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/nss_wrapper/nss_wrapper.c

index 4f9251e72f653a7259a554ac74c6cd8b78dc24d9..653b8d7bfcd5d6cea182457b639fd99ff1aeaf63 100644 (file)
@@ -3320,8 +3320,7 @@ static int nwrap_files_gethostbyname(const char *name, int af,
                                     struct hostent *result,
                                     struct nwrap_vector *addr_list)
 {
-       struct nwrap_entlist *el_head;
-       struct nwrap_entlist *el_cur;
+       struct nwrap_entlist *el;
        struct hostent *he;
        char *h_name_lower;
        ENTRY e;
@@ -3370,9 +3369,9 @@ static int nwrap_files_gethostbyname(const char *name, int af,
        }
 
        /* Iterate through results */
-       el_head = (struct nwrap_entlist *)e_p->data;
-       for (el_cur = el_head; el_cur != NULL; el_cur = el_cur->next) {
-               he = &(el_cur->ed->ht);
+       for (el = (struct nwrap_entlist *)e_p->data; el != NULL; el = el->next)
+       {
+               he = &(el->ed->ht);
 
                /* Filter by address familiy if provided */
                if (af != AF_UNSPEC && he->h_addrtype != af) {
@@ -3394,7 +3393,7 @@ static int nwrap_files_gethostbyname(const char *name, int af,
                                  he->h_name);
                        he_found = true;
                }
-               nwrap_vector_merge(addr_list, &el_cur->ed->nwrap_addrdata);
+               nwrap_vector_merge(addr_list, &el->ed->nwrap_addrdata);
                result->h_addr_list = nwrap_vector_head(addr_list);
        }