Ver Fonte

tls: removed unsigned int comparison with <0

Daniel-Constantin Mierla há 11 anos atrás
pai
commit
7d6dc390ba
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      modules/tls/tls_config.c

+ 2 - 2
modules/tls/tls_config.c

@@ -84,7 +84,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
 	ip->len = 4;
 
 	if (str2int(&token->val, &v) < 0) goto err;
-	if (v < 0 || v > 255) goto err;
+	if (v > 255) goto err;
 
 	ip->u.addr[0] = v;
 
@@ -97,7 +97,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
 		if (ret < 0) return -1;
 		if (ret > 0 || t.type != CFG_TOKEN_ALPHA) goto err;
 		if (str2int(&t.val, &v) < 0)  goto err;
-		if (v < 0 || v > 255) goto err;
+		if (v > 255) goto err;
 		ip->u.addr[i] = v;
 	}