static char *get_node_help(const struct ec_comp_item *item)
{
const struct ec_comp_group *grp;
- const struct ec_pnode *state;
+ const struct ec_pnode *pstate;
const struct ec_node *node;
char *help = NULL;
const char *node_help = NULL;
- const char *node_desc = NULL;
+ char *node_desc = NULL;
grp = ec_comp_item_get_grp(item);
- for (state = ec_comp_group_get_state(grp); state != NULL;
- state = ec_pnode_get_parent(state)) {
- node = ec_pnode_get_node(state);
+ for (pstate = ec_comp_group_get_pstate(grp); pstate != NULL;
+ pstate = ec_pnode_get_parent(pstate)) {
+ node = ec_pnode_get_node(pstate);
if (node_help == NULL)
node_help = ec_dict_get(ec_node_attrs(node), "help");
if (node_desc == NULL)
if (asprintf(&help, "%-20s %s", node_desc, node_help) < 0)
return NULL;
+ ec_free(node_desc);
+
return help;
}
struct ec_comp *c = NULL;
struct ec_pnode *p = NULL;
char *line = NULL;
- unsigned int count;
+ size_t count;
char **helps = NULL;
int match = 0;
int cols;