summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-03-11 16:39:35 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-03-11 16:39:35 +0000
commitf6101d3efe56e72008663e99c5f928528c011b7e (patch)
tree847d14e79f5f055e991a9fb4bafd572244cccee9 /usr.sbin
parentdb69d37d8d8fdc323e28c68824f4f10156727557 (diff)
Use aspath_asprint() instead of this malloc, aspath_snprint() mess. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpctl/bgpctl.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c
index e060a7c18e4..cd4c33a939f 100644
--- a/usr.sbin/bgpctl/bgpctl.c
+++ b/usr.sbin/bgpctl/bgpctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpctl.c,v 1.46 2004/03/11 15:08:46 claudio Exp $ */
+/* $OpenBSD: bgpctl.c,v 1.47 2004/03/11 16:39:34 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -710,11 +710,8 @@ show_rib_summary_msg(struct imsg *imsg)
asdata = imsg->data;
asdata += sizeof(struct ctl_show_rib);
- aspath = malloc(aspath_strlen(asdata, rib->aspath_len) + 1);
- if (aspath == NULL)
+ if (aspath_asprint(&aspath, asdata, rib->aspath_len) == -1)
err(1, NULL);
- aspath_snprint(aspath, aspath_strlen(asdata,
- rib->aspath_len) + 1, asdata, rib->aspath_len);
if (strlen(aspath) > 0)
printf("%s ", aspath);