summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-03-15 11:21:46 +0100
committerMaria Matejka <mq@ucw.cz>2022-03-15 11:21:46 +0100
commitc53f547a0bf437fb95923b2a0b9ac497e474aef1 (patch)
treec4fd70c83ef16b8d343c42a6f77616ee56e8bba2 /nest
parent3c42f7af6a23de3f135235521318301e5b34f2de (diff)
Printf variant with a result allocated inside a pool / linpool
Diffstat (limited to 'nest')
-rw-r--r--nest/rt-table.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index b3ca3d05..a1e49c21 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -2094,12 +2094,7 @@ static struct resclass rt_class = {
rtable *
rt_setup(pool *pp, struct rtable_config *cf)
{
- int ns = strlen("Routing table ") + strlen(cf->name) + 1;
- void *nb = mb_alloc(pp, ns);
- ASSERT_DIE(ns - 1 == bsnprintf(nb, ns, "Routing table %s", cf->name));
-
- pool *p = rp_new(pp, nb);
- mb_move(nb, p);
+ pool *p = rp_newf(pp, "Routing table %s", cf->name);
rtable *t = ralloc(p, &rt_class);
t->rp = p;