cppcheck (vaguely) reported:
[lib/parse.c:448]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
protoent = getprotobyname(strcasecmp(str, "icmpv6") == 0
? "ipv6-icmp" : str);
if (protoent == NULL) {
- uint8_t protonum;
- int err;
+ uint8_t protonum = 0;
- if (!((err = string_to_u8(session, str, &protonum) == 0) &&
- (protoent = getprotobynumber(protonum)) != NULL))
+ if (string_to_u8(session, str, &protonum) ||
+ (protoent = getprotobynumber(protonum)) == NULL)
return syntax_err("cannot parse '%s' "
"as a protocol", str);
}