From 40deaf0ba234bb4b1bf8379557339c31a0088fdc Mon Sep 17 00:00:00 2001 From: claudio Date: Sat, 8 Sep 2018 09:29:25 +0000 Subject: [PATCH] Fix print_as_sets() a bit. OK benno@ --- usr.sbin/bgpd/rde_sets.c | 14 ++++++++------ 1 file 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 @@ -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"); -- 2.20.1