C's type conversion rules are a barrel of fun. Did you know that if you
add "2" to an "unsigned short", the result has the type "int", even
though, at least on a machine where "unsigned int" is longer than
"unsigned short", the result is always >= 0?
Add "2U" instead, so that one of the operands is an "unsigned int",
making the result an "unsigned int".
h_ie_names[element_id], ie_len);
}
}
- if (caplen < 2 + ie_len) {
+ if (caplen < 2U + ie_len) {
ND_PRINT("[ERROR: Truncated IE data]");
return -1;
}
ND_PRINT("\n\t%s [ length = %d, ",
p_ie_names[group_id], ie_len);
}
- if (caplen < 2 + ie_len) {
+ if (caplen < 2U + ie_len) {
ND_PRINT("[ERROR: Truncated IE data]");
return -1;
}