Skip to content

Commit b5d77e0

Browse files
lint
1 parent 006d3b3 commit b5d77e0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

source/host_utils.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0.
44
*/
55
#include <aws/common/host_utils.h>
6+
#include <aws/common/logging.h>
67
#include <aws/common/string.h>
78
#include <inttypes.h>
8-
#include <aws/common/logging.h>
99

1010
#ifdef _MSC_VER /* Disable sscanf warnings on windows. */
1111
# pragma warning(disable : 4204)
@@ -76,13 +76,12 @@ bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded) {
7676
bool is_split = aws_byte_cursor_next_split(&host, '%', &substr);
7777
AWS_ASSERT(is_split); /* function is guaranteed to return at least one split */
7878

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)) {
8180
return false;
8281
}
8382

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 */
8685
return false;
8786
}
8887

@@ -106,7 +105,7 @@ bool aws_host_utils_is_ipv6(struct aws_byte_cursor host, bool is_uri_encoded) {
106105
}
107106

108107
if (digit_count > 4 || /* too many digits in group */
109-
group_count > 8 ) { /* too many groups */
108+
group_count > 8) { /* too many groups */
110109
return false;
111110
}
112111
}

0 commit comments

Comments
 (0)