[gtk/wip/baedert/for-master] label: Pass <markup> length directly when parsing markup



commit 92c4dec475eae235991b636f5c16e193b3e7d74e
Author: Timm Bäder <mail baedert org>
Date:   Fri Apr 10 16:29:32 2020 +0200

    label: Pass <markup> 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 a396c815c6..69f0ec3a4d 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2218,7 +2218,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;
@@ -2244,13 +2244,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;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]