mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
lib: Handle vararg in graph pretty-print
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
78602b8029
commit
b84f1d850a
@ -251,7 +251,13 @@ pretty_print_graph (struct graph_node *start, int level)
|
|||||||
if (vector_active (start->children))
|
if (vector_active (start->children))
|
||||||
{
|
{
|
||||||
if (vector_active (start->children) == 1)
|
if (vector_active (start->children) == 1)
|
||||||
pretty_print_graph (vector_slot (start->children, 0), level);
|
{
|
||||||
|
struct graph_node *child = vector_slot (start->children, 0);
|
||||||
|
if (child == start)
|
||||||
|
fprintf (stdout, "*");
|
||||||
|
else
|
||||||
|
pretty_print_graph (vector_slot (start->children, 0), level);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
@ -260,7 +266,10 @@ pretty_print_graph (struct graph_node *start, int level)
|
|||||||
struct graph_node *r = vector_slot (start->children, i);
|
struct graph_node *r = vector_slot (start->children, i);
|
||||||
for (int j = 0; j < level+1; j++)
|
for (int j = 0; j < level+1; j++)
|
||||||
fprintf (stdout, " ");
|
fprintf (stdout, " ");
|
||||||
pretty_print_graph (r, level+1);
|
if (r == start)
|
||||||
|
fprintf (stdout, "*");
|
||||||
|
else
|
||||||
|
pretty_print_graph (r, level+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user