aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty/command.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-24 04:15:20 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-24 06:40:04 +0000
commitcf8def25d59f4453620e109c9f7f033d01fe4583 (patch)
tree7d9ea1f16e10bb63c85f7e1a41732e05b842ef9f /src/vty/command.c
parente65c8bad46a190f3de7594d545aa4954ad17b85f (diff)
vty reference: fix deprecation bit evaluation
In vty_dump_nodes(), make sure the bitwise & is evaluated first. For the deprecation flag (0x1), the practical effect is most likely identical, assuming that the boolean ! operator flips the first bit, so I expect no visible functional difference. It still was confusing and wrong to look at. Related: OS#3584 Change-Id: I1f18e0e41da4772d092d71261b9e489dc1598923
Diffstat (limited to 'src/vty/command.c')
-rw-r--r--src/vty/command.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 43f974ce..900680f7 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -679,7 +679,7 @@ static int vty_dump_nodes(struct vty *vty)
elem = vector_slot(cnode->cmd_vector, j);
if (!vty_command_is_common(elem))
continue;
- if (!elem->attr & CMD_ATTR_DEPRECATED)
+ if (!(elem->attr & CMD_ATTR_DEPRECATED))
vty_dump_element(elem, vty);
}
}
@@ -717,7 +717,7 @@ static int vty_dump_nodes(struct vty *vty)
elem = vector_slot(cnode->cmd_vector, j);
if (vty_command_is_common(elem))
continue;
- if (!elem->attr & CMD_ATTR_DEPRECATED)
+ if (!(elem->attr & CMD_ATTR_DEPRECATED))
vty_dump_element(elem, vty);
}