From d879d3517ef3654a22b9106aa77fc0eba0e9e0b2 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 14 Oct 2009 19:45:03 +0000 Subject: [PATCH] Fix bug in NEW macro used locally --- lib/xdot/xdot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xdot/xdot.c b/lib/xdot/xdot.c index 551b06cee..92ae4dddf 100755 --- a/lib/xdot/xdot.c +++ b/lib/xdot/xdot.c @@ -18,8 +18,8 @@ #include #include -#define NEW(t) (t*)malloc(sizeof(t)) -#define N_NEW(n,t) (t*)malloc((n)*sizeof(t)) +#define NEW(t) (t*)calloc(1, sizeof(t)) +#define N_NEW(n,t) (t*)calloc((n),sizeof(t)) /* the parse functions should return NULL on error */ static char *parseReal(char *s, double *fp) -- 2.40.0