Problem: magic literals for UCHAR_MAX

Solution: use UCHAR_MAX constant instead
This commit is contained in:
Simon Giesecke
2018-05-28 18:46:36 +02:00
parent a4c817e736
commit 7c2d1c1824
7 changed files with 21 additions and 12 deletions

View File

@@ -29,6 +29,7 @@
#include "precompiled.hpp"
#include <string.h>
#include <limits.h>
#include <set>
#include "options.hpp"
@@ -491,7 +492,7 @@ int zmq::options_t::setsockopt (int option_,
case ZMQ_TCP_ACCEPT_FILTER: {
std::string filter_str;
int rc = do_setsockopt_string_allow_empty_strict (
optval_, optvallen_, &filter_str, 255);
optval_, optvallen_, &filter_str, UCHAR_MAX);
if (rc == 0) {
if (filter_str.empty ()) {
tcp_accept_filters.clear ();
@@ -559,7 +560,7 @@ int zmq::options_t::setsockopt (int option_,
case ZMQ_ZAP_DOMAIN:
return do_setsockopt_string_allow_empty_relaxed (
optval_, optvallen_, &zap_domain, 255);
optval_, optvallen_, &zap_domain, UCHAR_MAX);
break;
// If curve encryption isn't built, these options provoke EINVAL