Blob Blame History Raw
From 8eb9f06b156c6362a17712cfed9c629dec297a2c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 6 Feb 2020 10:22:42 +0000
Subject: [PATCH] mlxml: Fix pointed target signedness.

xml-c.c: In function 'mllib_xml_to_string':
xml-c.c:199:47: error: pointer targets in passing argument 2 of 'caml_alloc_initialized_string' differ in signedness [-Werror=pointer-sign]
  199 |   strv = caml_alloc_initialized_string (size, mem);
      |                                               ^~~
      |                                               |
      |                                               xmlChar * {aka unsigned char *}

(cherry picked from commit ea10827b4cfb3cfe5f782421c01d2902e5f73f90)
---
 common/mlxml/xml-c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/mlxml/xml-c.c b/common/mlxml/xml-c.c
index a0fa0fc3d..715c3bb24 100644
--- a/common/mlxml/xml-c.c
+++ b/common/mlxml/xml-c.c
@@ -196,7 +196,7 @@ mllib_xml_to_string (value docv, value formatv)
   doc = docptr_val (docv);
   xmlDocDumpFormatMemory (doc, &mem, &size, Bool_val (formatv));
 
-  strv = caml_alloc_initialized_string (size, mem);
+  strv = caml_alloc_initialized_string (size, (const char *) mem);
   free (mem);
 
   CAMLreturn (strv);
-- 
2.18.4