diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-10-09 10:20:30 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-10-09 10:20:30 +0000 |
commit | 01992e044630e9bd74aff638e181c52fb294c266 (patch) | |
tree | bd380c79a0653bb512a253c0ef004034caa7e13b /debugXML.c | |
parent | 321be0c5bf7b74a3f5a21434ab2ad656b899bc11 (diff) | |
download | android_external_libxml2-01992e044630e9bd74aff638e181c52fb294c266.tar.gz android_external_libxml2-01992e044630e9bd74aff638e181c52fb294c266.tar.bz2 android_external_libxml2-01992e044630e9bd74aff638e181c52fb294c266.zip |
Joe Marcus Clarke reported a segfault on FBsd this was due to
* valid.c: Joe Marcus Clarke reported a segfault on FBsd
this was due to uninitialized parts of the validation context
Daniel
Diffstat (limited to 'debugXML.c')
-rw-r--r-- | debugXML.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1355,17 +1355,23 @@ xmlShellPrintXPathError(int errorType, const char *arg) static void xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node) { - if (!ctxt || !node) + FILE *fp; + + if (!node) return; + if (ctxt == NULL) + fp = stdout; + else + fp = ctxt->output; if (node->type == XML_DOCUMENT_NODE) - xmlDocDump(ctxt->output, (xmlDocPtr) node); + xmlDocDump(fp, (xmlDocPtr) node); else if (node->type == XML_ATTRIBUTE_NODE) - xmlDebugDumpAttrList(ctxt->output, (xmlAttrPtr) node, 0); + xmlDebugDumpAttrList(fp, (xmlAttrPtr) node, 0); else - xmlElemDump(ctxt->output, node->doc, node); + xmlElemDump(fp, node->doc, node); - fprintf(ctxt->output, "\n"); + fprintf(fp, "\n"); } /** |