diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-09-25 11:22:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-09-25 11:22:02 -0400 |
commit | 0ca83872468af59b94e14fe7fdfcb38cb5a3f496 (patch) | |
tree | 56e24a39afbcc16dc2b43a6b4eb422bec588651c /src/common | |
parent | 7f5103ec59e1e1da6c32e2bb0a3b1b6e437d57e4 (diff) | |
download | tor-0ca83872468af59b94e14fe7fdfcb38cb5a3f496.tar.gz tor-0ca83872468af59b94e14fe7fdfcb38cb5a3f496.zip |
Tweak address.c to use a little c99 syntax
Since address.c is the first file to get compiled, let's have it use
a little judicious c99 in order to catch broken compilers that
somehow make it past our autoconf tests.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/address.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/address.c b/src/common/address.c index 3a78f0be55..f79736dd0b 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); @@ -605,7 +604,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 +665,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; |