Verified Commit 60f4075e authored by Andrei Pavel's avatar Andrei Pavel 🐧

[#1495] fix non-printable numeric_limits

parent c1e3c626
......@@ -254,8 +254,9 @@ T HAConfigParser::getAndValidateInteger(const ConstElementPtr& config,
isc_throw(ConfigError, "'" << parameter_name << "' must not be negative");
} else if (value > std::numeric_limits<T>::max()) {
isc_throw(ConfigError, "'" << parameter_name << "' must not be greater than "
<< std::numeric_limits<T>::max());
isc_throw(ConfigError,
"'" << parameter_name << "' must not be greater than "
<< std::to_string(std::numeric_limits<T>::max()));
}
return (static_cast<T>(value));
......
......@@ -236,7 +236,8 @@ OptionDataTypeUtil::writeTuple(const std::string& value,
if (value.size() > std::numeric_limits<uint8_t>::max()) {
isc_throw(BadDataTypeCast, "invalid tuple value (size "
<< value.size() << " larger than "
<< std::numeric_limits<uint8_t>::max() << ")");
<< std::to_string(std::numeric_limits<uint8_t>::max())
<< ")");
}
buf.push_back(static_cast<uint8_t>(value.size()));
......@@ -267,7 +268,8 @@ OptionDataTypeUtil::writeTuple(const OpaqueDataTuple& tuple,
if (tuple.getLength() > std::numeric_limits<uint8_t>::max()) {
isc_throw(BadDataTypeCast, "invalid tuple value (size "
<< tuple.getLength() << " larger than "
<< std::numeric_limits<uint8_t>::max() << ")");
<< std::to_string(std::numeric_limits<uint8_t>::max())
<< ")");
}
buf.push_back(static_cast<uint8_t>(tuple.getLength()));
......
......@@ -599,9 +599,9 @@ OptionDefinition::lexicalCastWithRangeCheck(const std::string& value_str)
result < numeric_limits<T>::min()) {
isc_throw(BadDataTypeCast, "unable to convert '"
<< value_str << "' to numeric type. This value is "
" expected to be in the range of "
<< numeric_limits<T>::min()
<< ".." << numeric_limits<T>::max());
"expected to be in the range of "
<< to_string(numeric_limits<T>::min()) << ".."
<< to_string(numeric_limits<T>::max()));
}
}
return (static_cast<T>(result));
......
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