static void __save_xml_value(xmlTextReaderPtr reader, char **xml_attribute)
{
- xmlTextReaderRead(reader);
- const xmlChar *attrib_val = xmlTextReaderConstValue(reader);
+ int ret;
+ const xmlChar *attrib_val;
+
+ ret = xmlTextReaderRead(reader);
+ if (ret == -1)
+ return;
+ attrib_val = xmlTextReaderConstValue(reader);
if (attrib_val)
*xml_attribute = strdup((const char *)attrib_val);
static int __ps_process_icon(xmlTextReaderPtr reader, icon_x *icon, uid_t uid)
{
+ int ret;
+ char *text;
+
__save_xml_attribute(reader, "section", &icon->section, NULL);
__save_xml_attribute(reader, "size", &icon->size, NULL);
__save_xml_attribute(reader, "resolution", &icon->resolution, NULL);
__save_xml_lang(reader, &icon->lang);
- xmlTextReaderRead(reader);
- char *text = ASCII(xmlTextReaderValue(reader));
+ ret = xmlTextReaderRead(reader);
+ if (ret == -1)
+ return 0;
+ text = ASCII(xmlTextReaderValue(reader));
if (text) {
icon->text = __get_icon_with_path(text, uid);
free(text);