diff --git a/src/document/dom/node.c b/src/document/dom/node.c index 3ab91d55..043f553f 100644 --- a/src/document/dom/node.c +++ b/src/document/dom/node.c @@ -427,8 +427,8 @@ get_dom_node_value(struct dom_node *node, int codepage) break; case DOM_NODE_PROCESSING_INSTRUCTION: - value = node->data.proc_instruction.instruction; - valuelen = node->data.proc_instruction.instructionlen; + value = node->data.proc_instruction.instruction.string; + valuelen = node->data.proc_instruction.instruction.length; break; case DOM_NODE_CDATA_SECTION: diff --git a/src/document/dom/node.h b/src/document/dom/node.h index 3661f2ef..6313f9b6 100644 --- a/src/document/dom/node.h +++ b/src/document/dom/node.h @@ -160,8 +160,7 @@ struct dom_proc_instruction_node { /* The target of the processing instruction (xml for '') * is in the @string / @length members. */ /* This holds the value to be processed */ - unsigned char *instruction; - uint16_t instructionlen; + struct dom_string instruction; /* For fast checking of the target type */ uint16_t type; /* enum dom_proc_instruction_type */ @@ -276,8 +275,7 @@ add_dom_proc_instruction(struct dom_node *parent, unsigned char *string, int len struct dom_node *node = add_dom_node(parent, DOM_NODE_PROCESSING_INSTRUCTION, string, length); if (node && instruction) { - node->data.proc_instruction.instruction = instruction; - node->data.proc_instruction.instructionlen = instructionlen; + set_dom_string(&node->data.proc_instruction.instruction, instruction, instructionlen); } return node; diff --git a/src/document/dom/renderer.c b/src/document/dom/renderer.c index 05ccb0ae..7ea2a6e9 100644 --- a/src/document/dom/renderer.c +++ b/src/document/dom/renderer.c @@ -559,8 +559,8 @@ render_dom_proc_instr_source(struct dom_stack *stack, struct dom_node *node, voi render_dom_node_text(renderer, &renderer->styles[node->type], node); - value = node->data.proc_instruction.instruction; - valuelen = node->data.proc_instruction.instructionlen; + value = node->data.proc_instruction.instruction.string; + valuelen = node->data.proc_instruction.instruction.length; if (!value || node->data.proc_instruction.map) return node;