From cf8def25d59f4453620e109c9f7f033d01fe4583 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 24 Sep 2018 04:15:20 +0200 Subject: 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 --- src/vty/command.c | 4 ++-- 1 file 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); } -- cgit v1.2.3