From 577becec813defff23aef57d8c219326bce0b0ce Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 3 Oct 2021 10:15:48 -0700 Subject: [PATCH] =?utf8?q?replace=20'gvputs(=E2=80=A6=20xml=5Fstring0(?= =?utf8?q?=E2=80=A6))'=20with=20'xml=5Fescape(=E2=80=A6)'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is, again, a functional no-op. But it has the effect of removing dynamic allocations and making this code thread-safe. Related to #1868. --- plugin/core/gvrender_core_svg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 570bcaafb..1e94dd303 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -349,7 +349,8 @@ svg_begin_anchor(GVJ_t * job, char *href, char *tooltip, char *target, } if (tooltip && tooltip[0]) { GVPUTS(job, " xlink:title=\""); - gvputs(job, xml_string0(tooltip, 1)); + const xml_flags_t flags = {.raw = 1, .dash = 1, .nbsp = 1}; + xml_escape(tooltip, flags, (int(*)(void*, const char*))gvputs, job); GVPUTS(job, "\""); } if (target && target[0]) { @@ -478,7 +479,8 @@ static void svg_textspan(GVJ_t * job, pointf p, textspan_t * span) gvprintdouble(job, -p.y); GVPUTS(job, "\">"); } - gvputs(job, xml_string0(span->str, TRUE)); + const xml_flags_t xml_flags = {.raw = 1, .dash = 1, .nbsp = 1}; + xml_escape(span->str, xml_flags, (int(*)(void*, const char*))gvputs, job); if (obj->labeledgealigned) GVPUTS(job, ""); GVPUTS(job, "\n"); -- 2.49.0