3
3
* SPDX-License-Identifier: Apache-2.0.
4
4
*/
5
5
#include <aws/common/host_utils.h>
6
+ #include <aws/common/logging.h>
6
7
#include <aws/common/string.h>
7
8
#include <inttypes.h>
8
- #include <aws/common/logging.h>
9
9
10
10
#ifdef _MSC_VER /* Disable sscanf warnings on windows. */
11
11
# pragma warning(disable : 4204)
@@ -76,13 +76,12 @@ bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded) {
76
76
bool is_split = aws_byte_cursor_next_split (& host , '%' , & substr );
77
77
AWS_ASSERT (is_split ); /* function is guaranteed to return at least one split */
78
78
79
- if (!is_split || substr .len < 2 || substr .len > 39 ||
80
- !aws_byte_cursor_satisfies_pred (& substr , s_is_ipv6_char )) {
79
+ if (!is_split || substr .len < 2 || substr .len > 39 || !aws_byte_cursor_satisfies_pred (& substr , s_is_ipv6_char )) {
81
80
return false;
82
81
}
83
82
84
- if ((substr .ptr [0 ] == ':' && substr .ptr [1 ] != ':' ) || /* no single colon at start */
85
- (substr .ptr [substr .len - 1 ] == ':' && substr .ptr [substr .len - 2 ] != ':' )) { /* no single colon at end */
83
+ if ((substr .ptr [0 ] == ':' && substr .ptr [1 ] != ':' ) || /* no single colon at start */
84
+ (substr .ptr [substr .len - 1 ] == ':' && substr .ptr [substr .len - 2 ] != ':' )) { /* no single colon at end */
86
85
return false;
87
86
}
88
87
@@ -106,7 +105,7 @@ bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded) {
106
105
}
107
106
108
107
if (digit_count > 4 || /* too many digits in group */
109
- group_count > 8 ) { /* too many groups */
108
+ group_count > 8 ) { /* too many groups */
110
109
return false;
111
110
}
112
111
}
0 commit comments