-/* $OpenBSD: main.c,v 1.102 2021/02/19 08:14:49 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.103 2021/02/19 12:18:23 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
{
struct repo *rp;
- rt.repos = reallocarray(rt.repos, rt.reposz + 1, sizeof(struct repo));
+ rt.repos = recallocarray(rt.repos, rt.reposz, rt.reposz + 1,
+ sizeof(struct repo));
if (rt.repos == NULL)
- err(1, "reallocarray");
+ err(1, "recallocarray");
rp = &rt.repos[rt.reposz++];
- memset(rp, 0, sizeof(struct repo));
rp->id = rt.reposz - 1;
return rp;
-/* $OpenBSD: mft.c,v 1.26 2021/02/16 07:58:30 job Exp $ */
+/* $OpenBSD: mft.c,v 1.27 2021/02/19 12:18:23 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
/* Insert the filename and hash value. */
- p->res->files = reallocarray(p->res->files, p->res->filesz + 1,
- sizeof(struct mftfile));
+ p->res->files = recallocarray(p->res->files, p->res->filesz,
+ p->res->filesz + 1, sizeof(struct mftfile));
if (p->res->files == NULL)
err(1, NULL);
fent = &p->res->files[p->res->filesz++];
- memset(fent, 0, sizeof(struct mftfile));
fent->file = fn;
fn = NULL;
-/* $OpenBSD: roa.c,v 1.14 2021/02/16 07:58:30 job Exp $ */
+/* $OpenBSD: roa.c,v 1.15 2021/02/19 12:18:23 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
/* FIXME: maximum check. */
}
- p->res->ips = reallocarray(p->res->ips,
- p->res->ipsz + 1, sizeof(struct roa_ip));
+ p->res->ips = recallocarray(p->res->ips, p->res->ipsz, p->res->ipsz + 1,
+ sizeof(struct roa_ip));
if (p->res->ips == NULL)
err(1, NULL);
res = &p->res->ips[p->res->ipsz++];
- memset(res, 0, sizeof(struct roa_ip));
res->addr = addr;
res->afi = afi;