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:
Ryan Welton 2014-08-08 21:59:10 -04:00 committed by Erik Ekman
parent 9a45c4aa66
commit 434a023afe
2 changed files with 2 additions and 2 deletions

View file

@ -104,7 +104,7 @@ struct query {
};
enum connection {
CONN_RAW_UDP,
CONN_RAW_UDP = 0,
CONN_DNS_NULL,
CONN_MAX
};

View file

@ -199,7 +199,7 @@ user_set_conn_type(int userid, enum connection c)
if (userid < 0 || userid >= usercount)
return;
if (c < 0 || c >= CONN_MAX)
if (c < CONN_RAW_UDP || c >= CONN_MAX)
return;
users[userid].conn = c;