diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:46:32 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-04 00:46:32 -0500 |
commit | 74cbd8d55953969c15c60f025889b1e07a185a79 (patch) | |
tree | 2cbad1bc3a4ea158c383dd613726132809b3e40a /src/common/util.c | |
parent | 254ab5a8deb9ed5fb571016f402ffd7243208d73 (diff) | |
download | tor-74cbd8d55953969c15c60f025889b1e07a185a79.tar.gz tor-74cbd8d55953969c15c60f025889b1e07a185a79.zip |
fix indentation
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/common/util.c b/src/common/util.c index 83002997ef..c6a39898d9 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -963,9 +963,9 @@ string_is_key_value(int severity, const char *string) int string_is_valid_ipv4_address(const char *string) { - struct in_addr addr; + struct in_addr addr; - return (tor_inet_pton(AF_INET,string,&addr) == 1); + return (tor_inet_pton(AF_INET,string,&addr) == 1); } /** Return true if <b>string</b> represents a valid IPv6 address in @@ -974,9 +974,9 @@ string_is_valid_ipv4_address(const char *string) int string_is_valid_ipv6_address(const char *string) { - struct in6_addr addr; + struct in6_addr addr; - return (tor_inet_pton(AF_INET6,string,&addr) == 1); + return (tor_inet_pton(AF_INET6,string,&addr) == 1); } /** Return true iff <b>string</b> matches a pattern of DNS names @@ -985,38 +985,38 @@ string_is_valid_ipv6_address(const char *string) int string_is_valid_hostname(const char *string) { - int result = 1; - smartlist_t *components; + int result = 1; + smartlist_t *components; - components = smartlist_new(); + components = smartlist_new(); - smartlist_split_string(components,string,".",0,0); + smartlist_split_string(components,string,".",0,0); - SMARTLIST_FOREACH_BEGIN(components, char *, c) { - if (c[0] == '-') { - result = 0; - break; - } + SMARTLIST_FOREACH_BEGIN(components, char *, c) { + if (c[0] == '-') { + result = 0; + break; + } - do { - if ((*c >= 'a' && *c <= 'z') || - (*c >= 'A' && *c <= 'Z') || - (*c >= '0' && *c <= '9') || - (*c == '-')) - c++; - else - result = 0; - } while (result && *c); + do { + if ((*c >= 'a' && *c <= 'z') || + (*c >= 'A' && *c <= 'Z') || + (*c >= '0' && *c <= '9') || + (*c == '-')) + c++; + else + result = 0; + } while (result && *c); - } SMARTLIST_FOREACH_END(c); + } SMARTLIST_FOREACH_END(c); - SMARTLIST_FOREACH_BEGIN(components, char *, c) { - tor_free(c); - } SMARTLIST_FOREACH_END(c); + SMARTLIST_FOREACH_BEGIN(components, char *, c) { + tor_free(c); + } SMARTLIST_FOREACH_END(c); - smartlist_free(components); + smartlist_free(components); - return result; + return result; } /** Return true iff the DIGEST256_LEN bytes in digest are all zero. */ |