From 1f7acbd88fe739798cc1fb83870690e88b5d04e9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 6 Oct 2015 13:22:46 -0400 Subject: specialize vdup into idup --- lisc/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisc/util.c') diff --git a/lisc/util.c b/lisc/util.c index 723a8db..c1bfa86 100644 --- a/lisc/util.c +++ b/lisc/util.c @@ -67,10 +67,10 @@ bcnt(Bits *b) } void -vdup(void *pd, void *s, size_t sz) +idup(Ins **pd, Ins *s, ulong n) { - free(*(void **)pd); - memcpy(*(void **)pd = alloc(sz), s, sz); + free(*pd); + memcpy(*pd = alloc(n * sizeof(Ins)), s, n * sizeof(Ins)); } Ins * -- cgit 1.4.1