From: Perry Ruiter Date: Thu, 6 Mar 2014 05:53:16 +0000 (-0800) Subject: cellconfig: move memcpy outside loop X-Git-Tag: upstream/1.8.0_pre1^2~778 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=89fdd9084fa31827dea487ddb68355d621170f58;p=packages%2Fo%2Fopenafs.git cellconfig: move memcpy outside loop memcpy only needs to be done once prior to each entry into loop, so move it outside the loop. Change-Id: I68c09b240756f830b1a4dc9b8a338916f91cd7b2 Reviewed-on: http://gerrit.openafs.org/10872 Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: Michael Meffie Reviewed-by: Jeffrey Altman --- diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 9ff408251..11c51cddc 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -1414,9 +1414,9 @@ afsconf_GetCellInfo(struct afsconf_dir *adir, char *acellName, char *aservice, for (i=0 ; he->h_addr_list[i] && numServers < MAXHOSTSPERCELL; i++) { /* check to see if this is a new address; if so insert it into the list */ int k, dup; + afs_uint32 addr; + memcpy(&addr, he->h_addr_list[i], sizeof(addr)); for (k=0, dup=0; !dup && k < numServers; k++) { - afs_uint32 addr; - memcpy(&addr, he->h_addr_list[i], sizeof(addr)); if (hostAddr[k].sin_addr.s_addr == addr) { dup = 1; }