diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2023-01-26 14:45:11 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2023-01-27 12:01:20 +0100 | 
| commit | e678b143a9b715a008dd988b2da0ca15da919bc0 (patch) | |
| tree | 5625022bce39f3adef722fce11c200ce9c190f68 /bgpd/bgp_aspath.c | |
| parent | e59bd527e9b7818b315ba2cc6ad21a1ac9f2b161 (diff) | |
bgpd: fix format string mess in AS-path printing
This was done *very* weirdly.  Make it slightly less so.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_aspath.c')
| -rw-r--r-- | bgpd/bgp_aspath.c | 10 | 
1 files changed, 3 insertions, 7 deletions
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c index 85f09ccf0b..2ae693cd30 100644 --- a/bgpd/bgp_aspath.c +++ b/bgpd/bgp_aspath.c @@ -2122,16 +2122,12 @@ const char *aspath_print(struct aspath *as)  }  /* Printing functions */ -/* Feed the AS_PATH to the vty; the suffix string follows it only in case +/* Feed the AS_PATH to the vty; the space suffix follows it only in case   * AS_PATH wasn't empty.   */ -void aspath_print_vty(struct vty *vty, const char *format, struct aspath *as, -		      const char *suffix) +void aspath_print_vty(struct vty *vty, struct aspath *as)  { -	assert(format); -	vty_out(vty, format, as->str); -	if (as->str_len && strlen(suffix)) -		vty_out(vty, "%s", suffix); +	vty_out(vty, "%s%s", as->str, as->str_len ? " " : "");  }  static void aspath_show_all_iterator(struct hash_bucket *bucket,  | 
