diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-03 01:07:07 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-11-26 20:35:58 +0100 |
commit | db452508bf3d808a33b3fc04c946d8cc2939bbb7 (patch) | |
tree | 2dbc95e01dd6e2f4926e34e33d89475809e12dd5 /lib/northbound_cli.c | |
parent | lib: make it possible to create YANG data nodes containing state data (diff) | |
download | frr-db452508bf3d808a33b3fc04c946d8cc2939bbb7.tar.xz frr-db452508bf3d808a33b3fc04c946d8cc2939bbb7.zip |
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 8ae44e72d..c7378d244 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); |