]> granicus.if.org Git - graphviz/commitdiff
Fix uninitialized variable
authorerg <devnull@localhost>
Sat, 16 Aug 2008 18:02:24 +0000 (18:02 +0000)
committererg <devnull@localhost>
Sat, 16 Aug 2008 18:02:24 +0000 (18:02 +0000)
lib/neatogen/poly.c

index 056ba5525958201900906dd9637ec58e26cbefcb..5d83c81445f3c00e233cdd105e9c728303813719 100644 (file)
@@ -208,6 +208,14 @@ void makeAddPoly(Poly * pp, Agnode_t * n, float xmargin, float ymargin)
        case SH_POLY:
            poly = (polygon_t *) ND_shape_info(n);
            sides = poly->sides;
+           if (sides >= 3) {   /* real polygon */
+               verts = N_GNEW(sides, Point);
+               for (i = 0; i < sides; i++) {
+                   verts[i].x = PS2INCH(poly->vertices[i].x);
+                   verts[i].y = PS2INCH(poly->vertices[i].y);
+               }
+           } else
+               verts = genRound(n, &sides, 0, 0);
 
            if (streq(ND_shape(n)->name, "box"))
                pp->kind = BOX;