Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit d9275da

Browse files
committed
Fix -Wsign-compare warning.
The operands to `+` are promoted from `uint16_t` to `int` before addition, making the expression `off + len <= buflen` emit a warning because `buflen` is unsigned. Fixes: #514 PR-URL: #515 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 5c5b3ac commit d9275da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http_parser.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,7 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect,
25172517
end = buf + off + len;
25182518

25192519
/* NOTE: The characters are already validated and are in the [0-9] range */
2520-
assert(off + len <= buflen && "Port number overflow");
2520+
assert((size_t) (off + len) <= buflen && "Port number overflow");
25212521
v = 0;
25222522
for (p = buf + off; p < end; p++) {
25232523
v *= 10;

0 commit comments

Comments
 (0)