Skip to content

Commit

Permalink
policy: Use xml_node_is_empty() to check valid node
Browse files Browse the repository at this point in the history
  • Loading branch information
wipawel committed Jul 24, 2014
1 parent 474a25d commit a8f08ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/ifconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ extern ni_bool_t ni_nanny_call_add_secret(const ni_security_id_t *, const char
static inline ni_bool_t
ni_ifconfig_is_config(xml_node_t *ifnode)
{
return ifnode && ni_string_eq(ifnode->name, NI_CLIENT_IFCONFIG);
return !xml_node_is_empty(ifnode) && ni_string_eq(ifnode->name, NI_CLIENT_IFCONFIG);
}

static inline ni_bool_t
ni_ifconfig_is_policy(xml_node_t *pnode)
{
return pnode &&
return !xml_node_is_empty(pnode) &&
(ni_string_eq(pnode->name, NI_NANNY_IFPOLICY) ||
ni_string_eq(pnode->name, NI_NANNY_IFTEMPLATE));
}
Expand Down

0 comments on commit a8f08ac

Please sign in to comment.