mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-01 05:55:12 +00:00
Fix warning for comparing enum
CC user.c user.c:202:15: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (c < 0 || c >= CONN_MAX) ~ ^ ~
This commit is contained in:
parent
515bfb00a6
commit
5edf7c60b2
@ -104,7 +104,7 @@ struct query {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum connection {
|
enum connection {
|
||||||
CONN_RAW_UDP,
|
CONN_RAW_UDP = 0,
|
||||||
CONN_DNS_NULL,
|
CONN_DNS_NULL,
|
||||||
CONN_MAX
|
CONN_MAX
|
||||||
};
|
};
|
||||||
|
@ -199,7 +199,7 @@ user_set_conn_type(int userid, enum connection c)
|
|||||||
if (userid < 0 || userid >= usercount)
|
if (userid < 0 || userid >= usercount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (c < 0 || c >= CONN_MAX)
|
if (c < CONN_RAW_UDP || c >= CONN_MAX)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
users[userid].conn = c;
|
users[userid].conn = c;
|
||||||
|
Loading…
Reference in New Issue
Block a user