Browse code

tls: removed unsigned int comparison with <0

(cherry picked from commit 7d6dc390bac2b49615444bcbad74cd39f3c82302)

Daniel-Constantin Mierla authored on 06/12/2013 18:03:08
Showing 1 changed files
... ...
@@ -84,7 +84,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
84 84
 	ip->len = 4;
85 85
 
86 86
 	if (str2int(&token->val, &v) < 0) goto err;
87
-	if (v < 0 || v > 255) goto err;
87
+	if (v > 255) goto err;
88 88
 
89 89
 	ip->u.addr[0] = v;
90 90
 
... ...
@@ -97,7 +97,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
97 97
 		if (ret < 0) return -1;
98 98
 		if (ret > 0 || t.type != CFG_TOKEN_ALPHA) goto err;
99 99
 		if (str2int(&t.val, &v) < 0)  goto err;
100
-		if (v < 0 || v > 255) goto err;
100
+		if (v > 255) goto err;
101 101
 		ip->u.addr[i] = v;
102 102
 	}
103 103