1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2025-04-21 12:27:27 +03:00

eeshow/misc/util.h (realloc_size, realloc_type_n): get rid of bare "realloc"

Finally ! Shoulds have done this a long time ago.
This commit is contained in:
Werner Almesberger
2016-08-22 21:00:10 -03:00
parent 1b250bd467
commit 465a36fde5
9 changed files with 25 additions and 29 deletions

View File

@@ -46,10 +46,8 @@ static struct hist *new_commit(unsigned branch)
static void uplink(struct hist *down, struct hist *up)
{
down->newer = realloc(down->newer,
sizeof(struct hist *) * (down->n_newer + 1));
if (!down->newer)
diag_pfatal("realloc");
down->newer = realloc_type_n(down->newer, struct hist *,
down->n_newer + 1);
down->newer[down->n_newer++] = up;
}