summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 01237b0..1662f47 100644
--- a/util.c
+++ b/util.c
@@ -35,7 +35,7 @@ parseuri(const char *s, struct uri *u, int rel)
*p == '+' || *p == '-' || *p == '.'); p++)
;
if (!strncmp(p, "://", 3)) {
- if (p - s >= (ssize_t)sizeof(u->proto))
+ if ((size_t)(p - s) >= sizeof(u->proto))
return -1; /* protocol too long */
memcpy(u->proto, s, p - s);
u->proto[p - s] = '\0';
@@ -50,7 +50,7 @@ parseuri(const char *s, struct uri *u, int rel)
/* IPv6 address */
if (*p == '[') {
/* bracket not found or host too long */
- if (!(b = strchr(p, ']')) || b - p >= (ssize_t)sizeof(u->host))
+ if (!(b = strchr(p, ']')) || (size_t)(b - p) >= (ssize_t)sizeof(u->host))
return -1;
memcpy(u->host, p + 1, b - p - 1);
u->host[b - p - 1] = '\0';