[libgepub] lib: Fix warnings in xmlGetProp() usage



commit 073f3659b581ee10693a9f230b1da840702c3777
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 22 10:01:16 2017 +0200

    lib: Fix warnings in xmlGetProp() usage
    
    libxml's "BAD_CAST()" was made for this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784081

 libgepub/gepub-utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgepub/gepub-utils.c b/libgepub/gepub-utils.c
index 599aa19..d68be2e 100644
--- a/libgepub/gepub-utils.c
+++ b/libgepub/gepub-utils.c
@@ -44,7 +44,7 @@ set_epub_uri (xmlNode *node, const gchar *path, const gchar *tagname, const gcha
 
     for (cur_node = node; cur_node; cur_node = cur_node->next) {
         if (cur_node->type == XML_ELEMENT_NODE ) {
-            text = xmlGetProp (cur_node, attr);
+            text = xmlGetProp (cur_node, BAD_CAST (attr));
             if (!strcmp (cur_node->name, tagname) && text) {
                 SoupURI *uri = soup_uri_new_with_base (baseURI, text);
                 gchar *value = soup_uri_to_string (uri, FALSE);
@@ -152,7 +152,7 @@ gepub_utils_get_element_by_attr (xmlNode *node, const gchar *attr, const gchar *
 
     for (cur_node = node; cur_node; cur_node = cur_node->next) {
         if (cur_node->type == XML_ELEMENT_NODE ) {
-            text = xmlGetProp (cur_node, attr);
+            text = xmlGetProp (cur_node, BAD_CAST (attr));
             if (text && !strcmp (text, value)) {
                 xmlFree (text);
                 return cur_node;


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