Commit 85a11841 authored by Francis Dupont's avatar Francis Dupont
Browse files

[4091] Better odd check

parent e20f7d83
......@@ -593,7 +593,7 @@ OptionDataParser::createOption(ConstElementPtr option_data) {
// The decodeHex function expects that the string contains an
// even number of digits. If we don't meet this requirement,
// we have to insert a leading 0.
if (!data_param.empty() && data_param.length() % 2) {
if (!data_param.empty() && ((data_param.length() % 2) != 0)) {
data_param = data_param.insert(0, "0");
}
util::encode::decodeHex(data_param, binary);
......
......@@ -41,7 +41,7 @@ TokenHexString::evaluate(const Pkt& /*pkt*/, ValueStack& values) {
// The decodeHex function expects that the string contains an
// even number of digits. If we don't meet this requirement,
// we have to insert a leading 0.
if (repr_.length() % 2) {
if ((repr_.length() % 2) != 0) {
repr_ = repr_.insert(0, "0");
}
util::encode::decodeHex(repr_, binary);
......
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