label: Pass <markup> length directly when parsing markup

This commit is contained in:
Timm Bäder 2020-04-10 16:29:32 +02:00
parent b16157bc0d
commit 74b5eaa700

View File

@ -2223,7 +2223,7 @@ parse_uri_markup (GtkLabel *label,
guint *out_n_links,
GError **error)
{
GMarkupParseContext *context = NULL;
GMarkupParseContext *context;
const char *p, *end;
gsize length;
UriParserData pdata;
@ -2249,13 +2249,13 @@ parse_uri_markup (GtkLabel *label,
}
else
{
if (!g_markup_parse_context_parse (context, "<markup>", -1, error))
if (!g_markup_parse_context_parse (context, "<markup>", 8, error))
goto failed;
if (!g_markup_parse_context_parse (context, str, length, error))
goto failed;
if (!g_markup_parse_context_parse (context, "</markup>", -1, error))
if (!g_markup_parse_context_parse (context, "</markup>", 9, error))
goto failed;
}