diff --git a/usr.bin/netstat/common.c b/usr.bin/netstat/common.c index ac721b3e9ab..9dbbaeee25e 100644 --- a/usr.bin/netstat/common.c +++ b/usr.bin/netstat/common.c @@ -114,7 +114,7 @@ prepare_ifmap(size_t *pifmap_size) ifindex = sdl->sdl_index; if (ifindex >= ifmap_size) { - size = roundup(ifindex + 1, 32) * + size = roundup2(ifindex + 1, 32) * sizeof(struct ifmap_entry); if ((ifmap = realloc(ifmap, size)) == NULL) errx(2, "realloc(%d) failed", size); @@ -122,7 +122,7 @@ prepare_ifmap(size_t *pifmap_size) size - ifmap_size * sizeof(struct ifmap_entry)); - ifmap_size = roundup(ifindex + 1, 32); + ifmap_size = roundup2(ifindex + 1, 32); } if (*ifmap[ifindex].ifname != '\0') diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 44006da7f1f..51bed6e23c0 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -213,7 +213,7 @@ nhop_map_update(struct nhop_map *map, uint32_t idx, char *gw, char *ifname) else new_size = map->size * 2; if (new_size <= idx) - new_size = roundup(idx + 1, 32); + new_size = roundup2(idx + 1, 32); sz = new_size * (sizeof(struct nhop_entry)); if ((map->ptr = realloc(map->ptr, sz)) == NULL)