diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-02 22:07:07 -0200 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2018-11-26 17:35:58 -0200 |
| commit | db452508bf3d808a33b3fc04c946d8cc2939bbb7 (patch) | |
| tree | 2dbc95e01dd6e2f4926e34e33d89475809e12dd5 /lib/northbound_cli.c | |
| parent | 5e02643a64fb6aaaf95f6f9049020f392b5563d5 (diff) | |
lib, tools: use CHECK_FLAG/SET_FLAG more often in the northbound code
Cosmetic change to improve code readability a bit. No binary changes.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/northbound_cli.c')
| -rw-r--r-- | lib/northbound_cli.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c index 8ae44e72d5..c7378d2440 100644 --- a/lib/northbound_cli.c +++ b/lib/northbound_cli.c @@ -359,7 +359,7 @@ static int nb_cli_show_config_libyang(struct vty *vty, LYD_FORMAT format, { struct lyd_node *dnode; char *strp; - int options; + int options = 0; dnode = yang_dnode_dup(config->dnode); if (translator @@ -371,11 +371,11 @@ static int nb_cli_show_config_libyang(struct vty *vty, LYD_FORMAT format, return CMD_WARNING; } - options = LYP_FORMAT | LYP_WITHSIBLINGS; + SET_FLAG(options, LYP_FORMAT | LYP_WITHSIBLINGS); if (with_defaults) - options |= LYP_WD_ALL; + SET_FLAG(options, LYP_WD_ALL); else - options |= LYP_WD_TRIM; + SET_FLAG(options, LYP_WD_TRIM); if (lyd_print_mem(&strp, dnode, format, options) == 0 && strp) { vty_out(vty, "%s", strp); |
