]> granicus.if.org Git - graphviz/commitdiff
Fix bug in NEW macro used locally
authorerg <devnull@localhost>
Wed, 14 Oct 2009 19:45:03 +0000 (19:45 +0000)
committererg <devnull@localhost>
Wed, 14 Oct 2009 19:45:03 +0000 (19:45 +0000)
lib/xdot/xdot.c

index 551b06cee0f26bc2dd1344e42896cec5cc991880..92ae4dddf1788ec9c4735f7ff1b81c7e659b0fe9 100755 (executable)
@@ -18,8 +18,8 @@
 #include <string.h>
 #include <ctype.h>
 
-#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)