summaryrefslogtreecommitdiffstats
path: root/src/xplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xplist.c')
-rw-r--r--src/xplist.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 0c1a6b9..20b2795 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -289,19 +289,18 @@ static void xml_to_node(xmlNodePtr xml_node, plist_t * plist_node)
289 289
290 if (!xmlStrcmp(node->name, XPLIST_STRING)) { 290 if (!xmlStrcmp(node->name, XPLIST_STRING)) {
291 291
292 unsigned char *tmp = xmlNodeGetContent(node); 292 unsigned char *tmp = xmlNodeGetContent(node);
293 glong len = strlen((char*)tmp); 293 glong len = strlen((char *) tmp);
294 glong items_read = 0; 294 glong items_read = 0;
295 glong items_written = 0; 295 glong items_written = 0;
296 GError *error = NULL; 296 GError *error = NULL;
297 int type = xmlDetectCharEncoding(tmp, len); 297 int type = xmlDetectCharEncoding(tmp, len);
298 298
299 if (XML_CHAR_ENCODING_UTF8 == type) { 299 if (XML_CHAR_ENCODING_UTF8 == type) {
300 data->unicodeval = g_utf8_to_utf16((char*) tmp, len, &items_read, &items_written, &error); 300 data->unicodeval = g_utf8_to_utf16((char *) tmp, len, &items_read, &items_written, &error);
301 data->type = PLIST_UNICODE; 301 data->type = PLIST_UNICODE;
302 data->length = items_written; 302 data->length = items_written;
303 } 303 } else if (XML_CHAR_ENCODING_ASCII == type || XML_CHAR_ENCODING_NONE == type) {
304 else if (XML_CHAR_ENCODING_ASCII == type || XML_CHAR_ENCODING_NONE == type) {
305 data->strval = strdup((char *) xmlNodeGetContent(node)); 304 data->strval = strdup((char *) xmlNodeGetContent(node));
306 data->type = PLIST_STRING; 305 data->type = PLIST_STRING;
307 data->length = strlen(data->strval); 306 data->length = strlen(data->strval);