]> wimlib.net Git - wimlib/blobdiff - src/xml.c
utf8_to_utf16(), utf16_to_utf8() changes
[wimlib] / src / xml.c
index fd5cddf198205a2fbb767a8351464593371e696c..9fbe259f76e46ca686e6a1c571c63856637c964c 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -185,8 +185,8 @@ static u64 node_get_timestamp(const xmlNode *time_node)
 /* Used to sort an array of struct image_infos by their image indices. */
 static int sort_by_index(const void *p1, const void *p2)
 {
-       int index_1 = ((struct image_info*)p1)->index;
-       int index_2 = ((struct image_info*)p1)->index;
+       int index_1 = ((const struct image_info*)p1)->index;
+       int index_2 = ((const struct image_info*)p2)->index;
        if (index_1 < index_2)
                return -1;
        else if (index_1 > index_2)
@@ -1322,7 +1322,7 @@ int write_xml_data(const struct wim_info *wim_info, int image, FILE *out,
        encoding_handler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_UTF16LE);
        if (!encoding_handler) {
                ERROR("Failed to get XML character encoding handler for UTF-16LE");
-               ret = WIMLIB_ERR_CHAR_CONVERSION;
+               ret = WIMLIB_ERR_LIBXML_UTF16_HANDLER_NOT_AVAILABLE;
                goto out_cleanup_char_encoding_handlers;
        }