Browse files

* c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c

  valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string
  patch by Christian Persch, fixes #581612
  • Loading branch information...
1 parent 7dd7080 commit bccae2d21038967f5d83109f27b925bcd4795602 @veillard veillard committed Jun 4, 2009
Showing with 35 additions and 29 deletions.
  1. +6 −0 ChangeLog
  2. +1 −1 c14n.c
  3. +3 −3 debugXML.c
  4. +1 −1 doc/examples/io2.c
  5. +1 −1 parser.c
  6. +1 −1 schematron.c
  7. +1 −1 valid.c
  8. +1 −1 xmlschemas.c
  9. +2 −2 xmlwriter.c
  10. +18 −18 xpath.c
View
6 ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 4 11:17:23 CEST 2009 Daniel Veillard <daniel@veillard.com>
+
+ * c14n.c debugXML.c doc/examples/io2.c parser.c schematron.c
+ valid.c xmlschemas.c xmlwriter.c xpath.c: use %s to printf string
+ patch by Christian Persch
+
Thu Jun 4 11:06:07 CEST 2009 Daniel Veillard <daniel@veillard.com>
* parser.c threads.c: change the threading initialization sequence
View
2 c14n.c
@@ -234,7 +234,7 @@ xmlC14NErr(xmlC14NCtxPtr ctxt, xmlNodePtr node, int error,
__xmlRaiseError(NULL, NULL, NULL,
ctxt, node, XML_FROM_C14N, error,
XML_ERR_ERROR, NULL, 0,
- NULL, NULL, NULL, 0, 0, msg);
+ NULL, NULL, NULL, 0, 0, "%s", msg);
}
/************************************************************************
View
6 debugXML.c
@@ -141,9 +141,9 @@ xmlCtxtDumpSpaces(xmlDebugCtxtPtr ctxt)
return;
if ((ctxt->output != NULL) && (ctxt->depth > 0)) {
if (ctxt->depth < 50)
- fprintf(ctxt->output, &ctxt->shift[100 - 2 * ctxt->depth]);
+ fprintf(ctxt->output, "%s", &ctxt->shift[100 - 2 * ctxt->depth]);
else
- fprintf(ctxt->output, ctxt->shift);
+ fprintf(ctxt->output, "%s", ctxt->shift);
}
}
@@ -162,7 +162,7 @@ xmlDebugErr(xmlDebugCtxtPtr ctxt, int error, const char *msg)
NULL, ctxt->node, XML_FROM_CHECK,
error, XML_ERR_ERROR, NULL, 0,
NULL, NULL, NULL, 0, 0,
- msg);
+ "%s", msg);
}
static void
xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra)
View
2 doc/examples/io2.c
@@ -34,7 +34,7 @@ main(void)
* for demonstration purposes.
*/
xmlDocDumpFormatMemory(doc, &xmlbuff, &buffersize, 1);
- printf((char *) xmlbuff);
+ printf("%s", (char *) xmlbuff);
/*
* Free associated memory.
View
2 parser.c
@@ -493,7 +493,7 @@ xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
if (ctxt != NULL)
ctxt->errNo = error;
__xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
- XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, msg);
+ XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg);
if (ctxt != NULL) {
ctxt->wellFormed = 0;
if (ctxt->recovery == 0)
View
2 schematron.c
@@ -1425,7 +1425,7 @@ xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr ctxt,
(pattern == NULL)?NULL:((const char *) pattern->name),
(const char *) path,
(const char *) report, 0, 0,
- msg);
+ "%s", msg);
} else {
xmlSchematronReportOutput(ctxt, cur, &msg[0]);
}
View
2 valid.c
@@ -122,7 +122,7 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
__xmlRaiseError(NULL, channel, data,
pctxt, NULL, XML_FROM_VALID, error,
XML_ERR_ERROR, NULL, 0, NULL, NULL, NULL, 0, 0,
- msg);
+ "%s", msg);
}
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
View
2 xmlschemas.c
@@ -4274,7 +4274,7 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept
for (i = 0;((i < depth) && (i < 25));i++)
shift[2 * i] = shift[2 * i + 1] = ' ';
shift[2 * i] = shift[2 * i + 1] = 0;
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
if (particle->children == NULL) {
fprintf(output, "MISSING particle term\n");
return;
View
4 xmlwriter.c
@@ -129,10 +129,10 @@ xmlWriterErrMsg(xmlTextWriterPtr ctxt, xmlParserErrors error,
if (ctxt != NULL) {
__xmlRaiseError(NULL, NULL, NULL, ctxt->ctxt,
NULL, XML_FROM_WRITER, error, XML_ERR_FATAL,
- NULL, 0, NULL, NULL, NULL, 0, 0, msg);
+ NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg);
} else {
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_WRITER, error,
- XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, msg);
+ XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg);
}
}
View
36 xpath.c
@@ -334,7 +334,7 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
error + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
XML_ERR_ERROR, NULL, 0,
NULL, NULL, NULL, 0, 0,
- xmlXPathErrorMessages[error]);
+ "%s", xmlXPathErrorMessages[error]);
return;
}
ctxt->error = error;
@@ -345,7 +345,7 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
XML_ERR_ERROR, NULL, 0,
(const char *) ctxt->base, NULL, NULL,
ctxt->cur - ctxt->base, 0,
- xmlXPathErrorMessages[error]);
+ "%s", xmlXPathErrorMessages[error]);
return;
}
@@ -369,7 +369,7 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
XML_ERR_ERROR, NULL, 0,
(const char *) ctxt->base, NULL, NULL,
ctxt->cur - ctxt->base, 0,
- xmlXPathErrorMessages[error]);
+ "%s", xmlXPathErrorMessages[error]);
}
}
@@ -879,15 +879,15 @@ xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = ' ';
shift[2 * i] = shift[2 * i + 1] = 0;
if (cur == NULL) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "Node is NULL !\n");
return;
}
if ((cur->type == XML_DOCUMENT_NODE) ||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, " /\n");
} else if (cur->type == XML_ATTRIBUTE_NODE)
xmlDebugDumpAttr(output, (xmlAttrPtr)cur, depth);
@@ -904,7 +904,7 @@ xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = ' ';
shift[2 * i] = shift[2 * i + 1] = 0;
if (cur == NULL) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "Node is NULL !\n");
return;
@@ -927,7 +927,7 @@ xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = 0;
if (cur == NULL) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "NodeSet is NULL !\n");
return;
@@ -936,7 +936,7 @@ xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
if (cur != NULL) {
fprintf(output, "Set contains %d nodes:\n", cur->nodeNr);
for (i = 0;i < cur->nodeNr;i++) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "%d", i + 1);
xmlXPathDebugDumpNode(output, cur->nodeTab[i], depth + 1);
}
@@ -953,13 +953,13 @@ xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = 0;
if ((cur == NULL) || (cur->nodeNr == 0) || (cur->nodeTab[0] == NULL)) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "Value Tree is NULL !\n");
return;
}
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "%d", i + 1);
xmlXPathDebugDumpNodeList(output, cur->nodeTab[0]->children, depth + 1);
}
@@ -974,14 +974,14 @@ xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = 0;
if (cur == NULL) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "LocationSet is NULL !\n");
return;
}
for (i = 0;i < cur->locNr;i++) {
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "%d : ", i + 1);
xmlXPathDebugDumpObject(output, cur->locTab[i], depth + 1);
}
@@ -1008,7 +1008,7 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = 0;
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
if (cur == NULL) {
fprintf(output, "Object is empty (NULL)\n");
@@ -1063,22 +1063,22 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
if ((cur->user2 == NULL) ||
((cur->user2 == cur->user) && (cur->index == cur->index2))) {
fprintf(output, "Object is a collapsed range :\n");
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
if (cur->index >= 0)
fprintf(output, "index %d in ", cur->index);
fprintf(output, "node\n");
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
depth + 1);
} else {
fprintf(output, "Object is a range :\n");
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "From ");
if (cur->index >= 0)
fprintf(output, "index %d in ", cur->index);
fprintf(output, "node\n");
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
depth + 1);
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "To ");
if (cur->index2 >= 0)
fprintf(output, "index %d in ", cur->index2);
@@ -1111,7 +1111,7 @@ xmlXPathDebugDumpStepOp(FILE *output, xmlXPathCompExprPtr comp,
shift[2 * i] = shift[2 * i + 1] = ' ';
shift[2 * i] = shift[2 * i + 1] = 0;
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
if (op == NULL) {
fprintf(output, "Step is NULL\n");
return;
@@ -1298,7 +1298,7 @@ xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp,
shift[2 * i] = shift[2 * i + 1] = ' ';
shift[2 * i] = shift[2 * i + 1] = 0;
- fprintf(output, shift);
+ fprintf(output, "%s", shift);
fprintf(output, "Compiled Expression : %d elements\n",
comp->nbStep);

0 comments on commit bccae2d

Please sign in to comment.