]> granicus.if.org Git - graphviz/commitdiff
Fix uninitialized z coord when reading polylines
authorerg <devnull@localhost>
Fri, 6 Nov 2009 18:37:28 +0000 (18:37 +0000)
committererg <devnull@localhost>
Fri, 6 Nov 2009 18:37:28 +0000 (18:37 +0000)
lib/xdot/xdot.c

index 34301c50ed2a8e153a1a39106b10ca196921dec7..00abdf22337317b81acdfdc00740ae44524bb166 100755 (executable)
@@ -1,3 +1,4 @@
+/* $Id$Revision: */
 /* vim:set shiftwidth=4 ts=8: */
 
 /**********************************************************
@@ -19,7 +20,7 @@
 #include <ctype.h>
 
 #define NEW(t)           (t*)calloc(1, sizeof(t))
-#define N_NEW(n,t)       (t*)malloc((n)*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)
@@ -87,6 +88,7 @@ static char *parsePolyline(char *s, xdot_polyline * pp)
        }
        else
            s = endp;
+       ps->z = 0;
        ps++;
     }
     pp->pts = pts;