From 74b5eaa7000667ee5f178e47c9e91c5dbb2d2897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 10 Apr 2020 16:29:32 +0200 Subject: [PATCH] label: Pass length directly when parsing markup --- gtk/gtklabel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 5caf2ea1d0..34d51677c8 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -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, "", -1, error)) + if (!g_markup_parse_context_parse (context, "", 8, error)) goto failed; if (!g_markup_parse_context_parse (context, str, length, error)) goto failed; - if (!g_markup_parse_context_parse (context, "", -1, error)) + if (!g_markup_parse_context_parse (context, "", 9, error)) goto failed; }