Commit 7b7f7e4e authored by Christophe Juniet's avatar Christophe Juniet

Fix compilation warnings on unsigned comparisons.

Fix two unsigned comparisons to zero or more being always true. Clang
won't compile this with -Werror.
parent 78e47912
...@@ -264,7 +264,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, ...@@ -264,7 +264,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0; return 0;
} }
else else
if (optvallen_ >= 0 && optvallen_ < 256 && optval_ != NULL) { if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) {
plain_username.assign ((const char *) optval_, optvallen_); plain_username.assign ((const char *) optval_, optvallen_);
as_server = 0; as_server = 0;
mechanism = ZMQ_PLAIN; mechanism = ZMQ_PLAIN;
...@@ -278,7 +278,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, ...@@ -278,7 +278,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0; return 0;
} }
else else
if (optvallen_ >= 0 && optvallen_ < 256 && optval_ != NULL) { if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) {
plain_password.assign ((const char *) optval_, optvallen_); plain_password.assign ((const char *) optval_, optvallen_);
as_server = 0; as_server = 0;
mechanism = ZMQ_PLAIN; mechanism = ZMQ_PLAIN;
......
...@@ -105,4 +105,4 @@ Z85_decode (uint8_t *dest, char *string) ...@@ -105,4 +105,4 @@ Z85_decode (uint8_t *dest, char *string)
return dest; return dest;
} }
#endif #endif
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment