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
This commit is contained in:
Neels Hofmeyr 2018-09-24 04:15:20 +02:00 committed by Harald Welte
parent e65c8bad46
commit cf8def25d5
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}