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
... ...
@@ -91,7 +91,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
91 91
 	ip->len = 4;
92 92
 
93 93
 	if (str2int(&token->val, &v) < 0) goto err;
94
-	if (v < 0 || v > 255) goto err;
94
+	if (v > 255) goto err;
95 95
 
96 96
 	ip->u.addr[0] = v;
97 97
 
... ...
@@ -104,7 +104,7 @@ static int parse_ipv4(struct ip_addr* ip, cfg_token_t* token,
104 104
 		if (ret < 0) return -1;
105 105
 		if (ret > 0 || t.type != CFG_TOKEN_ALPHA) goto err;
106 106
 		if (str2int(&t.val, &v) < 0)  goto err;
107
-		if (v < 0 || v > 255) goto err;
107
+		if (v > 255) goto err;
108 108
 		ip->u.addr[i] = v;
109 109
 	}
110 110