diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-11-11 14:01:09 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2010-11-11 14:01:09 +0100 |
commit | 485d30a8a89e7500b0df4291fa4dfc33b894998c (patch) | |
tree | e1a8e86432887dd89fda460cc4ee00f08c74135d /src/attr.c | |
parent | 895839909804d91f6e897bef1c1e32c0b0a9db94 (diff) | |
download | libmnl-485d30a8a89e7500b0df4291fa4dfc33b894998c.tar.gz libmnl-485d30a8a89e7500b0df4291fa4dfc33b894998c.zip |
attr: remove redundant check for NULL
Calling mnl_attr_parse with cb==NULL is pointless, because the
function will do nothing else.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/attr.c')
-rw-r--r-- | src/attr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -260,7 +260,7 @@ int mnl_attr_parse(const struct nlmsghdr *nlh, unsigned int offset, int len = nlh->nlmsg_len - MNL_NLMSG_HDRLEN - MNL_ALIGN(offset); while (mnl_attr_ok(attr, len)) { - if (cb && (ret = cb(attr, data)) <= MNL_CB_STOP) + if ((ret = cb(attr, data)) <= MNL_CB_STOP) return ret; attr = mnl_attr_next(attr, &len); } @@ -289,7 +289,7 @@ int mnl_attr_parse_nested(const struct nlattr *nested, int len = mnl_attr_get_payload_len(nested); while (mnl_attr_ok(attr, len)) { - if (cb && (ret = cb(attr, data)) <= MNL_CB_STOP) + if ((ret = cb(attr, data)) <= MNL_CB_STOP) return ret; attr = mnl_attr_next(attr, &len); } |