Fix crash in record conv rule select YAZ-812
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Jan 2015 12:54:51 +0000 (13:54 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Jan 2015 12:54:51 +0000 (13:54 +0100)
src/record_conv.c

index e6e1cdd..2fbe986 100644 (file)
@@ -387,8 +387,8 @@ static int convert_select(void *vinfo, WRBUF record, WRBUF wr_error)
                         xmlNode *ptr = nodes->nodeTab[i];
                         if (ptr->type == XML_ELEMENT_NODE)
                             ptr = ptr->children;
-                        if (ptr->type == XML_TEXT_NODE)
-                            for (; ptr; ptr = ptr->next)
+                        for (; ptr; ptr = ptr->next)
+                            if (ptr->type == XML_TEXT_NODE)
                                 wrbuf_puts(record, (const char *) ptr->content);
                     }
                 }