summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-09-08 09:29:26 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-09-08 09:29:26 +0000
commit29b45921e2bbbb76b52dc48de9d7932b98177f9d (patch)
tree5726b565379c674f04c09d509998800da499437e /usr.sbin/bgpd
parentf7bfc4770cd1cedf25b81174adf29c50974e447a (diff)
Fix print_as_sets() a bit.
OK benno@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/rde_sets.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/rde_sets.c b/usr.sbin/bgpd/rde_sets.c
index 1d9e744ce50..fd1ac630717 100644
--- a/usr.sbin/bgpd/rde_sets.c
+++ b/usr.sbin/bgpd/rde_sets.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_sets.c,v 1.1 2018/09/07 05:43:33 claudio Exp $ */
+/* $OpenBSD: rde_sets.c,v 1.2 2018/09/08 09:29:25 claudio Exp $ */
/*
* Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org>
@@ -81,15 +81,17 @@ print_as_sets(struct as_set_head *as_sets)
{
struct as_set *aset;
size_t i;
- int len = 0;;
+ int len;
if (as_sets == NULL)
return;
SIMPLEQ_FOREACH(aset, as_sets, entry) {
- printf("as-set \"%s\" {", aset->name);
- for (i = 0; i < aset->nmemb; i++) {
- if (len == 0 || len > 72)
- len = printf("\n\t");
+ printf("as-set \"%s\" {\n\t", aset->name);
+ for (i = 0, len = 8; i < aset->nmemb; i++) {
+ if (len > 72) {
+ printf("\n\t");
+ len = 8;
+ }
len += printf("%u ", aset->set[i]);
}
printf("\n}\n\n");