From 636fdb8f87813f8756098c3b43f790fa9c6f14f0 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 6 Nov 2009 18:37:28 +0000 Subject: [PATCH] Fix uninitialized z coord when reading polylines --- lib/xdot/xdot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xdot/xdot.c b/lib/xdot/xdot.c index 34301c50e..00abdf223 100755 --- a/lib/xdot/xdot.c +++ b/lib/xdot/xdot.c @@ -1,3 +1,4 @@ +/* $Id$Revision: */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** @@ -19,7 +20,7 @@ #include #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; -- 2.50.1