]> granicus.if.org Git - graphviz/commitdiff
Fix bugs 1718 and 1720.
authorerg <devnull@localhost>
Fri, 4 Sep 2009 21:27:43 +0000 (21:27 +0000)
committererg <devnull@localhost>
Fri, 4 Sep 2009 21:27:43 +0000 (21:27 +0000)
lib/common/shapes.c

index 688ec5b8913b1a79c6d63ff7c5dae086040d5ec9..c7c54e2e1b4f5cca9844b3c437f00793e8baf65a 100644 (file)
@@ -2148,6 +2148,10 @@ static void record_init(node_t * n)
     flip = NOT(GD_realflip(agraphof(n)));
     reclblp = ND_label(n)->text;
     len = strlen(reclblp);
+    /* For some forgotten reason, an empty label is parsed into a space, so
+     * we need at least two bytes in textbuf.
+     */
+    len = MAX(len,1);  
     textbuf = N_NEW(len + 1, char);
     if (!(info = parse_reclbl(n, flip, TRUE, textbuf))) {
        agerr(AGERR, "bad label format %s\n", ND_label(n)->text);