BUILD: server: fix build warnings introduced by load-server-state
Commit e11cfcd ("MINOR: config: new backend directives:
load-server-state-from-file and server-state-file-name") caused these
warnings when building with Clang :
src/server.c:1972:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
(srv_uweight < 0) || (srv_uweight > SRV_UWGHT_MAX))
~~~~~~~~~~~ ^ ~
src/server.c:1980:21: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
(srv_iweight < 0) || (srv_iweight > SRV_UWGHT_MAX))
~~~~~~~~~~~ ^ ~
Indeed, srv_iweight and srv_uweight are unsigned. Just drop the offending test.
diff --git a/src/server.c b/src/server.c
index bc92c3c..c97c5bf 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1968,16 +1968,14 @@
p = NULL;
errno = 0;
srv_uweight = strtol(params[3], &p, 10);
- if ((p == params[3]) || errno == EINVAL || errno == ERANGE ||
- (srv_uweight < 0) || (srv_uweight > SRV_UWGHT_MAX))
+ if ((p == params[3]) || errno == EINVAL || errno == ERANGE || (srv_uweight > SRV_UWGHT_MAX))
chunk_appendf(msg, ", invalid srv_uweight value '%s'", params[3]);
/* validating srv_iweight */
p = NULL;
errno = 0;
srv_iweight = strtol(params[4], &p, 10);
- if ((p == params[4]) || errno == EINVAL || errno == ERANGE ||
- (srv_iweight < 0) || (srv_iweight > SRV_UWGHT_MAX))
+ if ((p == params[4]) || errno == EINVAL || errno == ERANGE || (srv_iweight > SRV_UWGHT_MAX))
chunk_appendf(msg, ", invalid srv_iweight value '%s'", params[4]);
/* validating srv_last_time_change */