From: erg Date: Fri, 21 Jan 2011 19:43:29 +0000 (+0000) Subject: Fix core dump when using -v and no font is found. X-Git-Tag: LAST_LIBGRAPH~32^2~1097 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19d28ff612f3af0b393ab4e1498c82db696aab53;p=graphviz Fix core dump when using -v and no font is found. --- diff --git a/lib/common/fontmetrics.c b/lib/common/fontmetrics.c index 30988b32d..d3b2490ff 100644 --- a/lib/common/fontmetrics.c +++ b/lib/common/fontmetrics.c @@ -206,9 +206,13 @@ pointf textsize(graph_t *g, textpara_t * para, char *fontname, double fontsize) if (! gvtextlayout(GD_gvc(g), para, fp)) estimate_textlayout(g, para, fp); - if (fp) - fprintf(stderr, "fontname: \"%s\" resolved to: %s\n", + if (fp) { + if (fontpath) + fprintf(stderr, "fontname: \"%s\" resolved to: %s\n", para->fontname, fontpath); + else + fprintf(stderr, "fontname: unable to resolve \"%s\"\n", para->fontname); + } size.x = para->width; size.y = para->height;