diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-01 11:33:07 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-01 11:33:07 -0400 |
commit | 1d18c2deb6d048a8d6f726e6c1b8ccbab4374e32 (patch) | |
tree | 544aeb563be67269a387a668b0c7ec22e0d4dcb1 /src/or/policies.c | |
parent | a0ae80788cc12284cd63ac678318f95e1238b257 (diff) | |
download | tor-1d18c2deb6d048a8d6f726e6c1b8ccbab4374e32.tar.gz tor-1d18c2deb6d048a8d6f726e6c1b8ccbab4374e32.zip |
Don't shadow parameters with local variables
This is a little error-prone when the local has a different type
from the parameter, and is very error-prone with both have the same
type. Let's not do this.
Fixes CID #437,438,439,440,441.
Diffstat (limited to 'src/or/policies.c')
-rw-r--r-- | src/or/policies.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index 983df8696e..1b5408c777 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -83,15 +83,15 @@ policy_expand_private(smartlist_t **policy) continue; } for (i = 0; private_nets[i]; ++i) { - addr_policy_t policy; - memcpy(&policy, p, sizeof(addr_policy_t)); - policy.is_private = 0; - policy.is_canonical = 0; - if (tor_addr_parse_mask_ports(private_nets[i], &policy.addr, - &policy.maskbits, &port_min, &port_max)<0) { + addr_policy_t newpolicy; + memcpy(&newpolicy, p, sizeof(addr_policy_t)); + newpolicy.is_private = 0; + newpolicy.is_canonical = 0; + if (tor_addr_parse_mask_ports(private_nets[i], &newpolicy.addr, + &newpolicy.maskbits, &port_min, &port_max)<0) { tor_assert(0); } - smartlist_add(tmp, addr_policy_get_canonical_entry(&policy)); + smartlist_add(tmp, addr_policy_get_canonical_entry(&newpolicy)); } addr_policy_free(p); }); |