From: erg Date: Fri, 4 Sep 2009 21:27:43 +0000 (+0000) Subject: Fix bugs 1718 and 1720. X-Git-Tag: LAST_LIBGRAPH~32^2~1719 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=262d86c6491e6ec874435909226c3b76a0ae563a;p=graphviz Fix bugs 1718 and 1720. --- diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 688ec5b89..c7c54e2e1 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -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);