diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-26 11:06:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-26 11:06:41 -0400 |
commit | 5190ec0bc4c22d7bab756e21db6e357ba07379c4 (patch) | |
tree | e8e4865ea0d044ccef63d27c64f9e6eadbba4ac6 /src/common | |
parent | 6e7cbfc465f9cbb2bd24ebeb019f542b2f4ccb2e (diff) | |
parent | b0767e85b8214677b7989723e55fbbf3ce24f3f2 (diff) | |
download | tor-5190ec0bc4c22d7bab756e21db6e357ba07379c4.tar.gz tor-5190ec0bc4c22d7bab756e21db6e357ba07379c4.zip |
Merge remote-tracking branch 'public/require_some_c99'
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/address.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/address.c b/src/common/address.c index 3a78f0be55..07b76597da 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -323,10 +323,9 @@ tor_addr_is_internal_(const tor_addr_t *addr, int for_listening, { uint32_t iph4 = 0; uint32_t iph6[4]; - sa_family_t v_family; tor_assert(addr); - v_family = tor_addr_family(addr); + sa_family_t v_family = tor_addr_family(addr); if (v_family == AF_INET) { iph4 = tor_addr_to_ipv4h(addr); @@ -472,7 +471,6 @@ tor_addr_parse_PTR_name(tor_addr_t *result, const char *address, if (!strcasecmpend(address, ".ip6.arpa")) { const char *cp; - int i; int n0, n1; struct in6_addr in6; @@ -480,7 +478,7 @@ tor_addr_parse_PTR_name(tor_addr_t *result, const char *address, return -1; cp = address; - for (i = 0; i < 16; ++i) { + for (int i = 0; i < 16; ++i) { n0 = hex_decode_digit(*cp++); /* The low-order nybble appears first. */ if (*cp++ != '.') return -1; /* Then a dot. */ n1 = hex_decode_digit(*cp++); /* The high-order nybble appears first. */ @@ -605,7 +603,7 @@ tor_addr_parse_mask_ports(const char *s, int any_flag=0, v4map=0; sa_family_t family; struct in6_addr in6_tmp; - struct in_addr in_tmp; + struct in_addr in_tmp = { .s_addr = 0 }; tor_assert(s); tor_assert(addr_out); @@ -666,7 +664,7 @@ tor_addr_parse_mask_ports(const char *s, tor_addr_from_ipv4h(addr_out, 0); any_flag = 1; } else if (!strcmp(address, "*6") && (flags & TAPMP_EXTENDED_STAR)) { - static char nil_bytes[16] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }; + static char nil_bytes[16] = { [0]=0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 }; family = AF_INET6; tor_addr_from_ipv6_bytes(addr_out, nil_bytes); any_flag = 1; |